Ranorex has developed a new, more comfortable way of Flash/Flex instrumentation. This alternative way makes it possible to automate Flash/Flex based applications without modifying the application itself.

To automate your application this way, you have to install the Adobe Debug Flash Player and use the new Ranorex Preloader for all Flash/Flex applications.

Flash/Flex Automation

Ranorex 3.1 comes with an instrumentation wizard which will setup the needed files and configurations for you.

Please see the Adobe Flash/Flex instrumentation wizard documentation page

Setting up the Ranorex Preloader:

 

  1. Install the Adobe Debug Flash Player on the machine on which you would like to record and execute Ranorex test scripts and for all browsers you would like to test with. The installers are available on Adobe’s download page.
  2. Download the Ranorex preloader package“RxPreloader.zip” (containing RanorexAutomation.swf and RanorexAutomation.swc”), save it to your local drive and extract it (in the following referred to as preloader location); in this example I will use “C:FlashFlexRanorexAutomation.swf” for the preloader location. Remember the location you placed the RanorexAutomation.swf file to, you will need it in the next steps!
  3. Open your user profile directory %UserProfile%, e.g. by opening Windows Explorer and copying the string %UserProfile% into the address bar.
  4. Create a new file called „mm.cfg” in your user profile directory and insert the following line of code, where “C:FlashFlexRanorexAutomation.swf” needs to be replaced by the preloader location from step 2:
    PreloadSwf= C:FlashFlexRanorexAutomation.swf

    Additional to this configuration entry you can enable the logging mechanisms of the Adobe Debug Flash Player, which might be helpful if you have any problems with this kind of instrumentation. In such a case you can then simply provide this logging information to our support team. To enable logging you have to add the following line of code to your “mm.cfg” file:

    TraceOutputFileEnable=1

    This additional configuration entry forces the Debug Player to create a log file at following location:
    C:UsersusernameAppDataRoamingMacromediaFlash PlayerLogs

  5. Open the following link and add the preloader location folder (from step 2), which contains the RanorexAutomation.swf file, to the trusted locations, for my example that is “C:FlashFlex”:
    http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04a.html#119065

After performing these steps you should be able to automate any Flash/Flex based application without any modification to the application. To verify that everything went right, you can use Ranorex Spy and track some controls within a Flash/Flex application (e.g. this Flash example).

The new Ranorex Preloader can also be used as “Automation Lib” or as “Module” the same way as described in our Flash/Flex Technology instrumentation chapter within the Ranorex User Guide (use the .swf or .swc file stored in “RxPreloader.zip” instead of the files located in the Bin directory of your Ranorex installation):

Please note when using the Adobe Debug Flash Player you might get some error messages that are not shown by the normal Flash Player. These error messages are based on the fact that the Debug Player is more verbose regarding error handling than the normal Flash Player. The shown error messages are caused by the Flash application and are usually not referable to the Ranorex instrumentation.

You might also like these articles