Search Flex Components Free

Custom Search

December 12, 2007

Flex 3.0 Installing and Configuring Flex Automated Testing

To use Flex Automated Testing, you must install Flex Builder 3. You cannot use Flex Automated Testing with only the Flex 3 SDK.

Flex Automated Testing SWC files are installed by default with Flex Builder 3. They are located in the /frameworks/libs directory with the other SWC files. You can begin using Flex Automated Testing and build your own custom agents without any further installation.

To use run-time automated testing (recommended):

Open a command prompt.
Navigate to the flex_builder_root/sdks/3.0.0/templates/automation-runtimeloading-files directory.
Execute the build.bat file. This compiles the runtimeloading.mxml file into a SWF file.
Copy the runtimeloading.swf and RunTimeLoading.html file to your web server. Copy the Flex application that you want to test to this server as well (the application need not be compiled with automation libraries).
Request the RunTimeLoading.html file and pass your Flex application as the automationswfurl query string parameter; for example:
To compile your applications with static automation support:

Start Flex Builder.
Create a new Flex Project.
Select your new Flex project in the Navigator.
Select Project > Properties > Flex Compiler.
In the "Additional compiler arguments" field, enter the following:
-include-libraries "flex_builder_dir\sdks\3.0.0\frameworks\libs\automation.swc"
"flex_builder_dir\sdks\3.0.0\frameworks\libs\automation_agent.swc" "flex_builder_dir\sdks\3.0.0\frameworks\libs\qtp.swc"
The -include-libraries compiler option is relative to the Flex Builder installation directory; the default on Windows is "C:\Program Files\Adobe\Flex Builder 3\".

6. Click the OK button to save your changes and OK to close the project Properties dialog box.
7. Compile your Flex application.
Examples and documentation for using custom agents can be found at Custom Agents.

To use Flex Automated Testing with the Flex 3 Plug-in for Mercury QuickTest Pro, you must perform additional steps. The rest of this section describes how to install and use the Flex 3 Plug-in for Mercury QuickTest Pro.

[edit]Requirements for Using the QTP Plug-in
To test applications with Flex Automated Testing and the QTP agent, you must install the following:

Mercury QuickTest Professional 9.1 or later (no support for Smart Identification)
Mercury QuickTest Professional 9.2 and patch 1701 if you want Smart Identification support
Adobe Flex 3 Plug-in for Mercury QuickTest Pro
Microsoft Internet Explorer, version 6 or later
Flash Player ActiveX control, version or higher
[edit]Installing the Plug-in
This section describes the steps necessary for a QC testing professional to configure QTP to work with Flex applications. You must install QTP and the plug-in.

To install QTP:

Install Flash Player 9 ActiveX control ( or higher) for Microsoft Internet Explorer. This is currently the only supported browser/player.
Install QTP 9.1 or later if you do not require support for Smart Identification. If you want to use Smart Identification, install QTP 9.2 and patch 1701. You must get QTP 9.1 from Mercury.
If you are using Mercury QTP on Microsoft Windows Vista you need to turn off the User Account Control (UAC) feature. Instructions to turn off UAC are available here
Restart your computer.
To install the Flex 3 Plug-in for Mercury QuickTest Pro:

Run the flex_builder_root/Installers/QTP_Plugin_Installer.exe.
Start QTP.
Close QTP.
In addition to the plug-in's DLLs and XML files, the plug-in installer includes the following in the installation directory:

/demo — Contains a Flash movie that describes the basics of using the plug-in. Be sure to enable audio on your computer.
/Uninstall Adobe Flex 3 Plug-in for Mercury QuickTest Pro — Contains the uninstaller.
[edit]Using the Plug-in
Start QTP again after installing the plug-in. The Add-in Manager lists the Flex plug-in.
Select the Flex plug-in in the Add-in Manager.
Select New > Test and click the Record button.
NOTE: Flex application testing with QTP currently supports only Microsoft Internet Explorer with the ActiveX Flash Player.

For more information on these tasks and using QTP to test Flex applications, see Testing with QTP.

For information on the operations and properties of Flex objects in QTP, see QTP Object Type Information.

[edit]Samples for Automated Testing
Sample custom agents are available at Custom Automation Agents.

An application ready for testing with QTP can be found at Flexstore AT. This sample can be used to test if the QTP plugin installation was successful.

An example for automating custom components can be found at Automating Custom Component.

[edit]Using automation with the Adobe Flex Component Kit for Flash CS3
You can create Flex controls, containers, skins, and other assets in Flash CS3 Professional, and then import those assets into your Flex application. When you want to automate an application that uses such assets, you must include the automation_flashflexkit.swc library.

If you are using run-time loading, re-compile the runtimeloading.swf file by using the build.bat file in flex_builder_root\sdks\3.0.0\templates\automation-runtimeloading-files\. The batch file includes the necessary libraries.

If you are compiling automation support into your application, add the automation_flashflexkit.swc to your include-libraries compiler option. This is in addition to the other automation SWC files. The SWC files are located in the flex_builder_root\sdks\3.0.0\frameworks\libs directory.

Related Flex Tutorials