Adobe Flex 3 Help

Tasks and techniques for testable applications overview

Flex developers should review the information about tasks and techniques for creating testable applications, and then update their Flex applications accordingly. QC testing professionals who use QTP should use the documentation provided in the separate book, Testing Adobe Flex Applications with Mercury QuickTest Professional. That document is available for download with the Flex plug-in for QTP.

Use the following general steps to create a testable application:

  1. Review the guidelines for creating testable applications. For more information, see Creating testable applications.
  2. Prepare the application to use automation at run time or build your own testable application.
    • To use automation at run time, you use a wrapper SWF file that is compiled with the automation libraries. This wrapper SWF file uses the SWFLoader to load your application SWF file that you plan to test only at run time. The HTML template and the MXML source code for the wrapper SWF file are included for you in the flex_builder_install_dir/sdks/3.0.0/templates/automation-runtimeloading-files directory. For more information, see Use run-time loading.
    • To build a testable application, you include automation libraries at compile time. Compile the application's SWF file with the automation.swc and automation_agent.swc files specified in the compiler's include-libraries option. If your application uses charts or the AdvancedDataGrid classes, you must also add the automation_dmv.swc file. If you are using the QTP plug-in, add the qtp.swc file. For information on the compilation process, see Compiling applications for testing.

    If you build your own testable application, you must also create an HTML wrapper with proper object naming. If you are using Flex Builder, you can generate a wrapper automatically. If you are using the SDK, you can use the wrapper templates in the flex_sdk/templates directory to create a wrapper for your application. When using a wrapper, the value of the id attributes can not contain any periods or hyphens.

  3. Prepare customized components for testing. If you have custom components that extend UIComponent, make them testable. For more information, see Instrumenting custom components.
  4. Deploy the application's assets to a web server. Assets can include the SWF file; HTML wrapper and related files; external assets such as theme files, graphics, and video files; module SWF files; resource modules; CSS SWF files; and run-time shared libraries (RSLs). For information about what files to deploy with your application, see Deployment checklist.