Configure Flex application using tools

You can configure your Flex application for functional testing using the tools like command-line compiler and Flex Builder.


Related concepts

Flex support

Flex applications testing process

Test Rational Functional Tester enabled Flex applications

Test Flex applications that are not enabled using Rational Functional Tester


Use the command-line compiler to enable Flex applications

Developers can compile a Flex application with the IBM Rational Functional Tester agent and Flex Automation Libraries from a command line and enable the application for functional testing.


About this task

Compile the Flex application using the IBM Rational Functional Tester agent and Flex Automation Libraries by running the following command.

To compile and enable a Flex 2.0 application for functional testing: At the command line, type the following, and press Enter:

"flex builder installation directory\Flex SDK 2\bin\mxmlc" -include-libraries+="flex builder installation directory\Flex SDK 2\frameworks\libs\automation.swc;flex builder installation directory\frameworks\libs\automation_agent.swc;flex builder installation directory\Flex SDK 2\frameworks\libs\automation_charts.swc;functional tester installation directory\FunctionalTester\bin\rft.swc;functional tester installation directory\FunctionalTester\bin\rftProp.swc" Test.mxml

To compile and enable a Flex 3.0 application for functional testing: At a command line, type the following command, and press Enter. In the command, Test.mxml is the name of your .mxml file.

"flex builder installation directory\Flex Builder 3\sdks\3.0.0\bin\mxmlc.exe"-include-libraries+="flex builder installation directory\Flex Builder 3\sdks\3.0.0\frameworks\libs\automation.swc;flex builder installation directory\Flex Builder 3\sdks\3.0.0\frameworks\libs\automation_agent.swc;flex builder installation directory\Flex Builder 3\sdks\3.0.0\frameworks\libs\automation_dmv.swc;flex builder installation directory\rftFlex3.0.swc;functional tester installation directory\rftProp_Flex3.0.swc" Test.mxml

To compile and enable a Flex 3.2 application for functional testing: At a command line, type the following command, and press Enter:

"flex builder installation directory\Flex Builder 3\sdks\3.2.0\bin\mxmlc.exe"-include-libraries+="flex builder installation directory\Flex Builder 3\sdks\3.2.0\frameworks\libs\automation.swc;flex builder installation directory\Flex Builder 3\sdks\3.2.0\frameworks\libs\automation_agent.swc;flex builder installation directory\Flex Builder 3\sdks\3.2.0\frameworks\libs\automation_dmv.swc;flex builder installation directory\rftFlex3.0.swc;functional tester installation directory\rftProp_Flex3.0.swc" Test.mxml

To compile and enable a Flex 3.3 application for functional testing: At a command line, type the following command, and press Enter:

"flex builder installation directory\Flex Builder 3\sdks\3.3.0\bin\mxmlc.exe"-include-libraries+="flex builder installation directory\Flex Builder 3\sdks\3.3.0\frameworks\libs\automation.swc;flex builder installation directory\Flex Builder 3\sdks\3.3.0\frameworks\libs\automation_agent.swc;flex builder installation directory\Flex Builder 3\sdks\3.3.0\frameworks\libs\datavisualization.swc;flex builder installation directory\rftFlex3.0.swc;functional tester installation directory\rftProp_Flex3.0.swc" Test.mxml

The above command has Flex 3.3 SDK deployed at flex builder installation directory\Flex Builder 3\sdks\ with directory as 3.3.0.

To compile and enable a Flex 3.4 application for functional testing: At a command line, type the following command, and press Enter:

"flex builder installation directory\Flex Builder 3\sdks\3.4.0\bin\mxmlc.exe"-include-libraries+="flex builder installation directory\Flex Builder 3\sdks\3.4.0\frameworks\libs\automation.swc;flex builder installation directory\Flex Builder 3\sdks\3.4.0\frameworks\libs\automation_agent.swc;flex builder installation directory\Flex Builder 3\sdks\3.4.0\frameworks\libs\datavisualization.swc;flex builder installation directory\rftFlex3.0.swc;functional tester installation directory\rftProp_Flex3.0.swc" Test.mxml

The above command has Flex 3.4 SDK deployed at flex builder installation directory\Flex Builder 3\sdks\ with directory as 3.4.0.

To compile and enable a Flex 3.5 application for functional testing: At a command line, type the following command, and press Enter:

"flex builder installation directory\Flex Builder 3\sdks\3.5.0\bin\mxmlc.exe"-include-libraries+="flex builder installation directory\Flex Builder 3\sdks\3.5.0\frameworks\libs\automation.swc;flex builder installation directory\Flex Builder 3\sdks\3.5.0\frameworks\libs\automation_agent.swc;flex builder installation directory\Flex Builder 3\sdks\3.5.0\frameworks\libs\datavisualization.swc;flex builder installation directory\rftFlex3.0.swc;functional tester installation directory\rftProp_Flex3.0.swc" Test.mxml

The above command has Flex 3.5 SDK deployed at flex builder installation directory\Flex Builder 3\sdks\ with directory as 3.5.0.

To compile and enable a Flex 4.0 application for functional testing: At a command line, type the following command, and press Enter:

"flash builder installation directory\Flash Builder 4\sdks\4.0\bin\mxmlc.exe"-include-libraries+="flash builder installation directory\Flash Builder 4\sdks\4.0\frameworks\libs\automation.swc;flash builder installation directory\Flash Builder 4\sdks\4.0\frameworks\libs\automation_agent.swc;flash builder installation directory\Flash Builder 4\sdks\4.0\frameworks\libs\datavisualization.swc;flash builder installation directory\rftFlex4.0.swc;functional tester installation directory\rftProp_Flex4.0.swc" Test.mxml

The above command has Flex 4.0 SDK deployed at flash builder installation directory\Flash Builder 4\sdks\ with directory as 4.0.

The datavisualization.swc component is separately available at the Adobe site.

The default Flex Builder install directory on Windows is C:\Program Files\Adobe.

This command is also available as a batch file with IBM Rational Functional Tester installed. Testers can provide this batch file to the developer to enable the Flex application for testing. Provide the flex application source code filename as the parameter to the batch file.

The batch file is available in functional tester install directory\Functional Tester\Flex folder.


Example

For example, if your .mxml file is Test.mxml, the command to run the batch file is as follows:

For Flex 2.0:

buildapplicationwithadaptor.bat Test.mxml
For Flex 3.0:
buildapplicationwithFlex3adaptor.bat Test.mxml
For Flex 3.2:
buildapplicationwithFlex32adaptor.bat Test.mxml


Use Flex Builder to enable Flex applications

Developers can use the Flex Builder to make Flex applications ready for functional testing.


About this task

Flex Builder is useful for developers who want to develop Flex applications (.swf files) that are ready for functional testing. To set up Flex Builder to support Flex automation and functional testing:


Procedure

  1. Start Flex Builder.

  2. Create a new Flex project.

  3. Select the Flex project in the navigator.

  4. Click Select Project > Properties > Flex Compiler.

  5. Type the following argument in the Additional compiler arguments field:

    For Flex 2.0:

    -include-libraries "flex builder installation directory\Flex SDK 2\frameworks\libs\automation.swc” “flex builder installation directory\Flex SDK\frameworks\libs\automation_agent.swc” "flex builder installation directory\Flex SDK\frameworks\libs\automation_charts.swc" “functional tester installation directory\Functional Tester\bin\rft.swc” “functional tester installation directory\Functional Tester\bin\rftProp.swc”

    In Flex 2.0, the automation_charts.swc file is required only if your application contains charting controls. The include-libraries compiler option is relative to the Flex Builder installation directory. The default Windows location is C:\Program Files\Adobe\Flex Builder.

    For Flex 3.0:

    -include-libraries "flex builder installation directory\Flex Builder 3\sdks\3.0.0\frameworks\libs\automation.swc” “flex builder installation directory\Flex Builder 3\sdks\3.0.0\frameworks\libs\automation_agent.swc” "flex builder installation directory\Flex Builder 3\sdks\3.0.0\frameworks\libs\automation_dmv.swc" “functional tester installation directory\rftFlex3.0.swc“ “functional tester installation directory\rftProp_Flex3.0.swc“

    For Flex 3.2:

    -include-libraries "flex builder installation directory\Flex Builder 3\sdks\3.2.0\frameworks\libs\automation.swc” “flex builder installation directory\Flex Builder 3\sdks\3.2.0\frameworks\libs\automation_agent.swc” "flex builder installation directory\Flex Builder 3\sdks\3.2.0\frameworks\libs\automation_dmv.swc" “functional tester installation directory\rftFlex3.0.swc“ “functional tester installation directory\rftProp_Flex3.0.swc“

    For Flex 3.3:

    -include-libraries "flex builder installation directory\Flex Builder 3\sdks\3.3.0\frameworks\libs\automation.swc” “flex builder installation directory\Flex Builder 3\sdks\3.3.0\frameworks\libs\automation_agent.swc” "flex builder installation directory\Flex Builder 3\sdks\3.3.0\frameworks\libs\automation_dmv.swc" “functional tester installation directory\rftFlex3.0.swc“ “functional tester installation directory\rftProp_Flex3.0.swc“

    For Flex 3.4:

    -include-libraries "flex builder installation directory\Flex Builder 3\sdks\3.4.0\frameworks\libs\automation.swc” “flex builder installation directory\Flex Builder 3\sdks\3.4.0\frameworks\libs\automation_agent.swc” "flex builder installation directory\Flex Builder 3\sdks\3.4.0\frameworks\libs\datavisualization.swc" “functional tester installation directory\rftFlex3.0.swc“ “functional tester installation directory\rftProp_Flex3.0.swc“

    For Flex 3.5:

    -include-libraries "flex builder installation directory\Flex Builder 3\sdks\3.5.0\frameworks\libs\automation.swc” “flex builder installation directory\Flex Builder 3\sdks\3.5.0\frameworks\libs\automation_agent.swc” "flex builder installation directory\Flex Builder 3\sdks\3.5.0\frameworks\libs\datavisualization.swc" “functional tester installation directory\rftFlex3.0.swc“ “functional tester installation directory\rftProp_Flex3.0.swc“

    For Flex 4.0:

    -include-libraries "flash builder installation directory\Flash Builder 4\sdks\4.0\frameworks\libs\automation.swc” “flash builder installation directory\Flash Builder 4\sdks\4.0\frameworks\libs\automation_agent.swc” "flash builder installation directory\Flash Builder 4\sdks\4.0\frameworks\libs\datavisualization.swc" “functional tester installation directory\rftFlex4.0.swc“ “functional tester installation directory\rftProp_Flex4.0.swc“
    Elements in italics are variables and depend on your directory structure.

  6. Click OK to save your changes.

  7. Click OK. The Properties dialog box closes.

  8. Compile your Flex application.