Forum Discussion

chris_cropley's avatar
chris_cropley
New Contributor
12 years ago

Instrumenting Flex Application for Test Complete - SecurityError

Hi,



We are running into difficulty with instrumenting our Flex Applicaiton for use with Test Complete.



We have followed the help as described in this document.  



http://support.smartbear.com/viewarticle/28667/



Exerpts are as follows:




package com.sohnar.traffic


{


 import spark.components.WindowedApplication;


 


 if (CONFIG::Automation) {


  import FlexClient.Agent;


 }


 


 CONFIG::CustomSystemManager {


 [Frame(factoryClass="com.sohnar.traffic.TrafficSystemManager")]


 }


 public class TrafficWindowedApplication extends WindowedApplication {


  


  if (CONFIG::Automation) {


   function TrafficWindowedApplication() {


    super();


    FlexClient.Agent.initApplication(stage);


   }


  }


 }


}



The application compiles without trouble however when starting it on a stand alone machine the following error is generated at start up.




SecurityError: Error #3207: Application-sandbox content cannot access this feature.


 at flash.system::Security$/allowDomain()


 at FlexClient::Agent()


 at FlexClient::Agent$/init()




 at flash.events::EventDispatcher/dispatchEventFunction()


 at flash.events::EventDispatcher/dispatchEvent()


 at mx.preloaders::Preloader/timerHandler()[F:\hudson\hudson-slave\workspace\flex-sdk_release\frameworks\projects\framework\src\mx\preloaders\Preloader.as:572]


 at flash.utils::Timer/_timerDispatch()


 at flash.utils::Timer/tick()



Any advice would be gratefully appreciated.



Regards,



Chris



 



7 Replies

  • jose_pita's avatar
    jose_pita
    Super Contributor

    I just got feedback from TC support, my problem is different because I'm working with a mobile app.


     


    If you want to use it on a desktop app you just have to add this lines to the air-config.xml file on "C:\Program Files (x86)\Adobe\Adobe Flash Builder 4.6\sdks\4.10.0\frameworks":


     


    <library>C:/Program Files (X86)/Smartbear/TestComplete 9/Open Apps/Flex/AirClient4.swc </library>


    <library>C:/Program Files (X86)/Smartbear/TestComplete 9/Open Apps/Flex/AirClient.swc</library>


    <library>C:/Program Files (X86)/Smartbear/TestComplete 9/Open Apps/Flex/AirClient35.swc</library>


          </include-libraries>


     


    Tried just now and it works.


    Don't add the flexclient files, otherwise won't work, at least for me it doesn't.

  • Thanks for your suggestions.  I have asked the developers to follow Jose suggestion and are making progress.  



    We have compiled our AUT and when starting the application it is now coming up with this error.




    TypeError: Error #1009: Cannot access a property or method of a null object reference.


     at AIRClient::Agent()


     at AIRClient::Agent$/init()


     at com.sohnar.traffic::TrafficWindowedApplication()[/usr/traffic/hudsonWorkSpace/jobs/TrafficDesktopRobotClient/workspace/RLTrafficMainApplication/src/as3/com/sohnar/traffic/TrafficWindowedApplication.as:16]


     at RLTrafficMainApplication()[/usr/traffic/hudsonWorkSpace/jobs/TrafficDesktopRobotClient/workspace/RLTrafficMainApplication/src/as3/RLTrafficMainApplication.mxml:18]



    I have searched other forums and not seen a suitable solution.



    Any suggestions?



    Thanks in advance,



    Chris

  • jose_pita's avatar
    jose_pita
    Super Contributor
    Tell them to try each file individually, even with the flex ones. Each file fits a different flex sdk / air sdk version, probably you just have to try different combinations...



    the ones I put above works with flex sdk 4.10 and air version 3.9.
  • Jose,



    Right you are.  The Dev had a bit of a think and after a bit of 'magic' he managed to get it working.



    His comment is below which I think is related to your most recent post.



    "stage was null, so i waited for application complete before calling init"



    Thank you for your quick and accurate responses.



    Regards,



    Chris