Forum Discussion

kcsahu777's avatar
kcsahu777
Contributor
13 years ago

Flex application object hierarchy issue

I am using test complete 8.7

Tested application is flex. It is developed in Java, Flex and Flash Player 10.x.



In test complete's object browser all objects are coming under one hierarchy level.

Please check the attachement.



Even if new popup or subwindow appears on the screen, the components of these screens too appear in the same hierarchy level.



Why is this show? This makes it difficult while name mapping by unique identification.





  • Hi Krushna,





    This means that TestComplete doesn't treat your application as Flex Open Application for some reason. Please let me know which approach to test Flex application you use, so I'll be able to help you troubleshoot the issue. You can find a list containing all the available approaches in the "Which Testing Approach to Choose" help topic.


  • Thanks for replying. Please check below



     I have tried the below approach with  FlashInjector explained in the brlow URL



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



    ---------------------------------------------------------------------------------------------------------------------------------------------



    1)     But after  installing the Windows Flash Player 11.1 ActiveX control content debugger (for IE) (EXE, 3.93 MB) ,  I am not able to find the mm.cfg  file.



    Do I need to install anything else?



    The tested application is accessed in the form  URL like below



    http://....com:8088/.../bin/release/APP.swf

    ---------------------------------------------------------------------------------------------------------------------------------------------



    2) I  tried  creaating Manual HTML wrapper page given in http://support.smartbear.com/viewarticle/13009/



    While tried to open the page I get error as  below



    SecurityError: Error #2148: SWF file http://....com:8088/.../bin/release/APP.swf

    cannot access local resource file:///C:/Documents%20and%20Settings/All%20Users/labelvalues.xml. Only local-with-filesystem and trusted local SWF files may access local resources.

     at flash.net::URLStream/load()

     at flash.net::URLLoader/load()

     at flash.net::URLLoader()

     at PTPMGUI/application1_creationCompleteHandler()[C:\Projects\Trident\PTI\MAIN\PTPMGUI\src\PTPMGUI.mxml:83]

     at PTPMGUI/___PTPMGUI_Application1_applicationComplete()[C:\Projects\Trident\PTI\MAIN\PTPMGUI\src\PTPMGUI.mxml:9]

     at flash.events::EventDispatcher/dispatchEventFunction()

     at flash.events::EventDispatcher/dispatchEvent()

     at mx.core::UIComponent/dispatchEvent()

     at mx.managers::SystemManager/preloader_preloaderDoneHandler()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\managers\SystemManager.as:2502]

     at flash.events::EventDispatcher/dispatchEventFunction()

     at flash.events::EventDispatcher/dispatchEvent()

     at mx.preloaders::Preloader/displayClassCompleteHandler()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\preloaders\Preloader.as:555]

     at flash.events::EventDispatcher/dispatchEventFunction()

     at flash.events::EventDispatcher/dispatchEvent()

     at com.nyx.splashscreen::CustomPreloader/initCompleteHandler()[C:\Projects\Trident\PTI\MAIN\PTPMGUI\src\com\nyx\splashscreen\CustomPreloader.as:39]

     at flash.events::EventDispatcher/dispatchEventFunction()

     at flash.events::EventDispatcher/dispatchEvent()

     at mx.preloaders::Preloader/dispatchAppEndEvent()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\preloaders\Preloader.as:358]

     at mx.preloaders::Preloader/appCreationCompleteHandler()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\preloaders\Preloader.as:563]

     at flash.events::EventDispatcher/dispatchEventFunction()

     at flash.events::EventDispatcher/dispatchEvent()

     at mx.core::UIComponent/dispatchEvent()

     at mx.core::UIComponent/set initialized()

     at mx.managers::LayoutManager/doPhasedInstantiation()

     at mx.managers::LayoutManager/doPhasedInstantiationCallback()



    -----------------------------------------------------------------------------------------------------------------------------------------------

    3) By proceeding further with opening the wrapper page  I donot get all componets appearing on the screen??


  • AlexeyKryuchkov's avatar
    AlexeyKryuchkov
    SmartBear Alumni (Retired)
    Hi Krushna,



    The mm.cfg file is required and needs to be created and configured manually if it hasn't been done automatically.



    The instructions from the "Configuring Adobe Flash Player for Using FlashInjector" help topic are all you need to follow to make the flashinjector.swf movie work in the needed way. However, in some cases, configuring Flash Player using the routines below is easier. If you execute them without interruption, they will log information about the needed configurations:



    //============= For Internet Explorer =======================



    function collectFlashInjectorConfigurationIE()

    {

      Sys.OleObject("WScript.Shell").Run("iexplore.exe");

      var iexplore = Sys.Process("iexplore");



      Log.Message("Information will be collected using " + iexplore.ProcessName + " " +  iexplore.FileVersionInfo);



      var versionPage = "http://kb2.adobe.com/cps/155/tn_15507.html";

      iexplore.ToUrl(versionPage);

      Delay (15000);

      Log.Picture(iexplore.Page(versionPage).Picture(), versionPage);



      var globalSecuritySettings = "http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html";

      iexplore.ToUrl(globalSecuritySettings);

      Delay (15000);

      Log.Picture(iexplore.Page(globalSecuritySettings).Picture(), globalSecuritySettings);



      var HOMEDRIVE = aqEnvironment.GetEnvironmentVariable("HOMEDRIVE");

      var HOMEPATH = aqEnvironment.GetEnvironmentVariable("HOMEPATH");

      var mmcfg = HOMEDRIVE + HOMEPATH + "\\mm.cfg";



      if (aqFileSystem.Exists(mmcfg))

      {

        Log.Message("The mm.cfg file was found in the " + HOMEDRIVE + HOMEPATH + " folder. The file's contents can be found in the Additional Information panel.", aqFile.OpenTextFile(mmcfg, aqFile.faRead, aqFile.ctUTF8).ReadAll());

      } else

      {

        Log.Warning("The mm.cfg file was not found in the " + HOMEDRIVE + HOMEPATH + " folder.");

      }



      Log.Message("OS: " + Sys.OSInfo.FullName);

    }



    //============= For Firefox ===============



    function collectFlashInjectorConfigurationFF()

    {

      Sys.OleObject("WScript.Shell").Run("firefox.exe");

      var firefox = Sys.Process("firefox");



      Log.Message("Information will be collected using " + firefox.AppInfo.name + " " +  firefox.AppInfo.version);



      var versionPage = "http://kb2.adobe.com/cps/155/tn_15507.html";

      firefox.ToUrl(versionPage);

      Delay (15000);

      Log.Picture(firefox.Page(versionPage).Picture(), versionPage);



      var globalSecuritySettings = "http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html";

      firefox.ToUrl(globalSecuritySettings);

      Delay (15000);

      Log.Picture(firefox.Page(globalSecuritySettings).Picture(), globalSecuritySettings);



      var HOMEDRIVE = aqEnvironment.GetEnvironmentVariable("HOMEDRIVE");

      var HOMEPATH = aqEnvironment.GetEnvironmentVariable("HOMEPATH");

      var mmcfg = HOMEDRIVE + HOMEPATH + "\\mm.cfg";



      if (aqFileSystem.Exists(mmcfg))

      {

        Log.Message("The mm.cfg file was found in the " + HOMEDRIVE + HOMEPATH + " folder. The file's contents can be found in the Additional Information panel.", aqFile.OpenTextFile(mmcfg, aqFile.faRead, aqFile.ctUTF8).ReadAll());

      } else

      {

        Log.Warning("The mm.cfg file was not found in the " + HOMEDRIVE + HOMEPATH + " folder.");

      }



      Log.Message("OS: " + Sys.OSInfo.FullName);

    }
  • Hi 



    Thanks for replying



    But I didn't get my queries answred.



    I ran the java copd  it gave the following output



    Information will be collected using iexplore 7.0.6000.17108

    http://kb2.adobe.com/cps/155/tn_15507.html

    http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html

    The mm.cfg file was not found in the I:\ folder.

    OS: Microsoft Windows XP Professional Service Pack 3



    how to config mm.cfg file. What should all it contain?  Also what about the error it shows when I run the wrapper page?


  • AlexeyKryuchkov's avatar
    AlexeyKryuchkov
    SmartBear Alumni (Retired)
    Hi Krushna,



    What will be contents of mm.cfg file?


    The answer is in the mentioned "Configuring Adobe Flash Player for Using FlashInjector" help topic:

    On a 32-bit version of Windows:



    PreloadSwf=C:\Program Files\Automated QA\TestComplete 8\Open Apps\Flex\FlashInjector.swf



    On a 64-bit version of Windows:



    PreloadSwf=C:\Program Files (x86)\Automated QA\TestComplete 8\Open Apps\Flex\FlashInjector.swf





    Also what about the error it shows when I run the wrapper page?


    The error message doesn't show any TestComplete-related problems. Does it happen if TestComplete is not running? If it does, try googling about this error or forwarding the error's text to your application developers.