This page is maintained for older versions of Rapise only. The latest documentation can be found at:
Tutorial: Testing Adobe Flex Applications

Tutorial: Testing Adobe Flex Applications

Top  Previous  Next





Create a Simple Flex Application: Hello Flex

Enable HelloFlex Application for Testing

  Link HelloFlex with Necessary Libraries

  Add HelloFlex to FlashPlayerTrust

Record a Simple Test

Execute the Test        

Using FlexLoader

See Also



After going through this tutorial you?ll get a basic idea of how to test browser-based Flex applications with Rapise.



This tutorial assumes that you have installed:

2.Adobe Flex Builder 3 (


Create a Simple Flex Application: HelloFlex

Let?s start from creation of a very simple Flex application.

1.Create home directory for the application: C:\HelloFlex. You may create any other directory that is more suitable for you, just do not forget to change corresponding paths used in this tutorial.
2.Create main file of the application: C:\HelloFlex\HelloFlex.mxml. Place the following code in it:

<?xml version="1.0" encoding="utf-8"?>





    horizontalAlign="center" verticalAlign="middle" 

    width="640" height="480"




            import mx.controls.Alert;




        paddingTop="10" paddingBottom="10" paddingLeft="10" paddingRight="10"

        title="My Application"  



    <mx:Label text="Hello Flex!" fontWeight="bold" fontSize="24"/>

    <mx:Button id="button" label="Button" click="{'Button Pressed');}"/>





3.Create wrapper HTML for the application: C:\HelloFlex\HelloFlex.html. Place the following code in it:

<html lang="en">


<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />




<body scroll="no">

       <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"

                       id="HelloFlex" width="100%" height="100%"


                       <param name="movie" value="HelloFlex.swf" />

                       <param name="quality" value="high" />

                       <param name="bgcolor" value="#869ca7" />

                       <param name="allowScriptAccess" value="sameDomain" />

                       <embed src="HelloFlex.swf" quality="high" bgcolor="#869ca7"

                               width="100%" height="100%" name="HelloFlex" align="middle"













4.Compile the application (make sure that mxmlc.exe is available in command line window. If Flex Builder is installed then it is available at: "c:\Program Files\Adobe\Flex Builder 3\sdks\<SDK Version>\bin\mxmlc.exe")

       a) Open CMD window in C:\HelloFlex directory

       b) Run command: mxmlc HelloFlex.mxml



5.Test the application by opening C:\HelloFlex\HelloFlex.html in Internet Explorer.



Enable HelloFlex Application for Testing

To make HelloFlex application testable by Rapise you need to link it with automation libraries.


Link HelloFlex with Necessary Libraries

Recompile HelloFlex application using the following command line that links automation.swc and automation_agent.swc from Flex Builder 3 and FlexAdapter.swc from Rapise:


mxmlc HelloFlex.mxml -locale en_US -include-libraries="c:/Program Files/Adobe/Flex Builder 3/sdks/<Version>/frameworks/libs/automation_agent.swc","c:/Program Files/Adobe/Flex Builder 3/sdks/<Version>/frameworks/libs/automation.swc","c:/Program Files/Inflectra/Rapise/Extensions/Flex/FlexAdapter/bin/FlexAdapter.swc"




Add HelloFlex to FlashPlayerTrust

Adobe Flash Player has restricted security settings for SWFs opened from file system. To enable testing of such SWFs their corresponding folders must be listed in FlashPlayerTrust directory.


Path to FlashPlayerTrust directory:


to enable testing for all users:



to enable testing just for current user:

<ApplicationData>\Macromedia\Flash Player\#Security\FlashPlayerTrust


(on Vista this path looks like:

c:\Users\<User Name>\AppData\Roaming\Macromedia\Flash Player\#Security\FlashPlayerTrust



To register your SWF just create a file with the name "<name of your SWF>.cfg" and put it in this directory. In the file write a path to SWF folder.


Note: If you do not have FlashPlayerTrust directory in one of locations listed above then you will have to create missing directories yourself.


To register c:\HelloFlex\HelloFlex.swf

       a) create file <ApplicationData>\Macromedia\Flash Player\#Security\FlashPlayerTrust\HelloFlex.cfg

       b) add this to the file: c:\HelloFlex



Record a Simple Test

1.Open C:\HelloFlex\HelloFlex.html in Internet Explorer.
2.Start Rapise and press Record/Learn button



3.Choose HelloFlex application and press Select, recording will start.



4.In HelloFlex application press Button and then press Ok in the alert message.



5.Then press Verify button on Recording activity dialog and click on "Hello Flex!" label. In Verify Object Properties dialog check Enabled property.



6.You have recorded three basic steps of your test.



7.Press Finish button on Recording activity dialog. You now have recorded the test.



Execute the Test


Execute the test by pressing the Play button in Rapise.


Congratulations! You have successfully completed this tutorial and now know basics of testing Flex applications with Rapise.


Using FlexLoader

If you do not want to compile your application with automation libraries you have an option to use FlexLoader.


FlexLoader is a Flex 3 application compiled with required automation libraries and capable of loading any given SWF application. With FlexLoader you do not need to modify your application to make it testable by Rapise.


To use FlexLoader just copy FlexLoader.html and FlexLoader.swf from c:/Program Files/Inflectra/Rapise/Extensions/Flex/FlexLoader/bin to your web server near your application. Then type in browser URL to FlexLoader.html and supply additional query parameter with the name of your SWF file, e.g.:


You can find sample application for testing here: c:/Program Files/Inflectra/Rapise/Extensions/Flex/FlexLoader/bin/Sample.swf


See Also

·Adobe Flex