Preparing Flex-Based AIR Applications for Testing

Applies to TestComplete 15.70, last modified on December 17, 2024

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.

TestComplete provides you with extended abilities to create flexible tests for Flex-based AIR applications. In order to test your Flex-based AIR applications, you do not have to change your code in any way, but you need to prepare your application in a special way.

Making AIR Applications' Internals Accessible to TestComplete

In order for TestComplete to be able to access objects of a Flex-based AIR application, you need to include the AIRClient helper library in the application and recompile it. Three versions of this library are shipped along with TestComplete and reside in the <TestComplete>\Open Apps\Flex folder. Each of the library versions is intended for a certain version of Flex SDK used to compile the application:

  • AIRClient.swc - the automated testing library for Flex SDK v. 3.3 and 3.4.
  • AIRClient35.swc - the automated testing library for Flex SDK v. 3.5 - 3.6.
  • AIRClient4.swc - the automated testing library for Flex SDK v. 4.0 - 4.6, 4.9 - 4.14.

You can specify the needed library to be included in your Flex AIR application in one of the following ways:

Using Flash Builder or Flex Builder IDE

Using the Flex compiler’s command line

Using the Flex compiler’s configuration file

If you do not include the AIRClient library in your Flex-based AIR application, the TestComplete test engine cannot access the application’s internals.

Important Notes

  • If the application's internals have not become visible to TestComplete after you prepared the application as described above, try to do the following:

    1. Add the following code to the application's main module file:
      import AIRClient.Agent;
    2. Add the call to the Agent.init(stage) function where stage is the top-level stage container:
      Agent.init(stage);

      This will send the top-level container to the TestComplete Agent class.

    3. Recompile the application.
  • When you are recording a test and trying to perform any action over a Flex-based AIR application that was not properly prepared for testing with TestComplete, the latter displays a balloon that warns you about this. To control whether this warning should be displayed, you can use the Show the "Application was not prepared properly" message option from the General | Show Again Flags page of the Options dialog.

See Also

Testing AIR Applications - Overview
Preparing HTML-Based AIR Applications for Testing

Highlight search results