0 Replies Latest reply on Mar 8, 2010 10:45 PM by Adnan Riaz

    Flex Automation - Runtime Loading not working

    Adnan Riaz

      Hi,

       

      I am trying to automate testing of my Flex Application but using Runtime loading of test automation libraries with QTP 10 and IE7.

       

      I am able to record and playback the sample flexstore application in QTP 10 using the Runtime loading method mentioned here. This means that my Flex Automation setup is Okay.

       

      The actual application that i need to automate loads external swf files so I am using following code to load my flex app with runtime loading support (as mentioned in the article):

       

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="actionScriptFunction()" >
          <mx:Script>
              <![CDATA[
                  import mx.controls.SWFLoader;
              import mx.controls.Alert;
             
              import flash.external.*;
              import flash.display.*;
              import flash.net.URLRequest;
              import flash.system.ApplicationDomain;
              import flash.system.LoaderContext;

      public function actionScriptFunction():void
      {
              var ldr:Loader = new Loader();

              var urlReq:URLRequest = new URLRequest(Application.application.parameters.automationswfurl);       
              var context:LoaderContext = new LoaderContext();
              context.applicationDomain = ApplicationDomain.currentDomain;
              ldr.load(urlReq, context);
      }

      ]]>
      </mx:Script>
            
      </mx:Application>

       

      The HTML for this swf passes query string automationswfurl. But the application does not load and there is no error either, I see initializing progressbar and then just blank flex page.