Run-Time Loading

You can load Flex automation support at run time using the Silk Test Flex Automation Launcher. This application is compiled with the automation libraries and loads your application with the SWFLoader class. This automatically enables your application for testing without compiling automation libraries into your SWF file. The Silk Test Flex Automation Launcher is available in HTML and SWF file formats.

Limitations

  • The Flex Automation Launcher Application automatically becomes the root application. If your application must be the root application, you cannot load automation support with the Silk Test Flex Automation Launcher.
  • Testing applications that load external libraries – Applications that load other SWF file libraries require a special setting for automated testing. A library that is loaded at run time (including run-time shared libraries (RSLs) must be loaded into the ApplicationDomain of the loading application. If the SWF file used in the application is loaded in a different application domain, automated testing record and playback will not function properly. The following example shows a library that is loaded into the same ApplicationDomain:
    import flash.display.*;
    
    import flash.net.URLRequest; 
    
    import flash.system.ApplicationDomain; 
    
    import flash.system.LoaderContext; 
    
     
    
    var ldr:Loader = new Loader(); 
    
     
    
    var urlReq:URLRequest = new URLRequest("RuntimeClasses.swf"); 
    
    var context:LoaderContext = new LoaderContext(); 
    
    context.applicationDomain = ApplicationDomain.currentDomain; 
    
    loader.load(request, context);