Compiling Flash and Flex Applications in Flash(Flex) Builder IDE

Applies to TestComplete 14.61, last modified on April 22, 2021

The information in this topic applies to web tests that locate web objects by using internal identification properties provided by TestComplete and run in local environments.

In order for TestComplete to be able to recognize objects in your Adobe Flash and Flex applications, you can compile your application with the FlexClient library included into the application. FlexClient is a helper library which is shipped along with TestComplete. Its purpose is to expose applications’ internal objects, methods and properties to TestComplete. This topic provides detailed instructions on how you can compile your application in the Adobe Flash Builder of Adobe Flex Builder IDE.

To include the FlexClient library in your Flash or Flex application using the Adobe Flash(Flex) Builder IDE, do the following:

Compiling Flex Applications With the FlexClient Library

In order to test your Flex application with TestComplete, the application needs to be compiled with the TestComplete FlexClient automated testing library. The TestComplete package includes different versions of this library intended for different versions of Flex SDK used for compiling the tested Flex application. All of them reside in the <TestComplete>\Open Apps\Flex folder:

  • FlexClient.swc - the automated testing library for Flex SDK v. 3.3 and 3.4.
  • FlexClient35.swc - the automated testing library for Flex SDK v. 3.5 - 3.6.
  • FlexClient4.swc - the automated testing library for Flex SDK v. 4.0 - 4.6, 4.9 - 4.14.
Note: Embedding the Automation libraries increases the size of the compiled application. So, remember to exclude the libraries before the final deployment of your application.

You can include the FlexClient library in your Flex application in one of the following ways:

Using Flash Builder or Flex Builder IDE
  1. Open your project in Flash Builder (or Flex Builder).

  2. Right-click the project node in Flash Builder’s Package Explorer (Flex Navigator in Flex Builder) and select Properties from the context menu, or select Project | Properties from the main menu of the IDE. This will bring up the Properties dialog.

  3. Select the Flex Compiler category and enter the following command in the Additional compiler arguments box:

    On a 32-bit version of Windows:

    -include-libraries "C:/Program Files/SmartBear/TestComplete 14/Open Apps/Flex/FlexClient4.swc"


    On a 64-bit version of Windows:

    -include-libraries "C:/Program Files (x86)/SmartBear/TestComplete 14/Open Apps/Flex/FlexClient4.swc"

    Note: This example demonstrates how to include the FlexClient4.swc library used with applications created with Flex SDK v. 4.0 - 4.6. If you use Flex SDK v. 3.5 - 3.6 to compile your application, you should use the FlexClient35.swc library. With Flex SDK v. 3.3 - 3.4, you should use FlexClient.swc.
  4. Save the changes and rebuild the project.

Using the Flex compiler’s command line

When building a Flex application from the command line, use the -include-libraries+= compiler option. The += postfix denotes that the list of included libraries should be appended rather than overwritten. For example:

On a 32-bit version of Windows:

mxmlc -include-libraries+= "C:/Program Files/SmartBear/TestComplete 14/Open Apps/Flex/FlexClient4.swc" c:/myflexapp/myflexapp.mxml


On a 64-bit version of Windows:

mxmlc -include-libraries+= "C:/Program Files (x86)/SmartBear/TestComplete 14/Open Apps/Flex/FlexClient4.swc" c:/myflexapp/myflexapp.mxml

Note: This example demonstrates how to include the FlexClient4.swc library used with applications created with Flex SDK v. 4.0 - 4.6. If you use Flex SDK v. 3.5 - 3.6 to compile your application, you should use the FlexClient35.swc library. With Flex SDK v. 3.3 - 3.4, you should use FlexClient.swc.
Using the Flex compiler’s configuration file

You can modify the Flex compiler’s configuration file, <Flex SDK>/frameworks/flex-config.xml, so that it will include the specified libraries in all the applications you will compile. For this purpose, uncomment the <include-libraries> node and add the following items:

XML

<flex-config>
   <compiler>
      ...
      <include-libraries>
         <!-- Use the following path on a 32-bit version of Windows -->
         <library>C:/Program Files/SmartBear/TestComplete 14/Open Apps/Flex/FlexClient4.swc</library>

         <!-- Use the following path on a 64-bit version of Windows -->
         <!--library>C:/Program Files (x86)/SmartBear/TestComplete 14/Open Apps/Flex/FlexClient4.swc</library-->
      </include-libraries>
      ...
   </compiler>
   ...
</flex-config>

Note: This example demonstrates how to include the FlexClient4.swc library used with applications created with Flex SDK v. 4.0 - 4.6. If you use Flex SDK v. 3.5 - 3.6 to compile your application, you should use the FlexClient35.swc library. With Flex SDK v. 3.3 - 3.4, you should use FlexClient.swc.

After you have compiled your Flash or Flex application with the FlexClient library included, you may need to perform some additional steps to prepare your application to properly test it with TestComplete. For instance, you may need to create a wrapper HTML page for the application and configure your web browser. For more instructions, see Preparing Flash and Flex Applications for Testing with the FlexClient Library.

Including Additional Libraries in the Application

Besides the FlexClient library, if your Flex application uses the controls listed below, you also need to include the following libraries into the application when compiling it (you need to specify the needed libraries in the compiler’s options in the same way as it is described above for the FlexClient library):

Control Names Library Description
Data Management and Visualization controls <Flash Builder>/sdks/4nn/frameworks/libs/automation/automation_dmv.swc

-- or --

<Flash Builder>/sdks/3nn/frameworks/libs/automation_dmv.swc

-- or --

<Flex 4 SDK>/frameworks/libs/automation/automation_dmv.swc

-- or --

<Flex Builder>/sdks/3nn/frameworks/libs/automation_dmv.swc
Implements automation for Data Management and Visualization controls, like charts and AdvancedDataGrids. Available in Adobe Flash Builder 4, Flex Builder 3 and Flex 4 SDK.
Controls created with Adobe Flex Component Kit for Flash CS3 <Flash Builder>/sdks/4nn/frameworks/libs/automation/automation_flashflexkit.swc

-- or --

<Flash Builder>/sdks/3nn/frameworks/libs/automation_flashflexkit.swc

-- or --

<Flex 4 SDK>/frameworks/libs/automation/automation_flashflexkit.swc

-- or --

<Flex Builder>/sdks/3nn/frameworks/libs/automation_flashflexkit.swc
Implements automation for controls, containers, skins, and other assets created with Adobe Flex Component Kit for Flash CS3. Available in Adobe Flash Builder 4, Flex Builder 3 and Flex 4 SDK.

See Also

Testing Flash and Flex Applications with the FlexClient Library
Requirements for Testing Flash and Flex Applications
Tips on Creating Testable Flash and Flex Applications

Highlight search results