Adobe Flex 3 Help

About creating custom agents

The automation API in Adobe® Flex® can be used for many tasks, including gathering metrics information, automated testing, and collaborative browsing (co-browsing).

To use the automation API, you should understand the following terminology:

  • agent -- An agent facilitates the communication between the Flex application and the automation tool. The way in which the communication happens depends on the automation tool, but it can include using the ExternalInterface API to access the browser's DOM or ActiveX plug-in. Agents are typically implemented in ActionScript and packaged as a SWC file.
  • automation tool -- An automation tool records, and sometimes plays back, interactions with Flex applications. An automation tool requires an agent to provide communication between it and the Flex application. Automation tools include Mercury QuickTest Professional™ (QTP) and Segue.

Full support for the Flex automation features is included in Adobe® Flex® Builder™ Professional. Adobe Flex Builder Standard allows only limited use of this feature.

To use the examples in this topic, you should download the customagent_src.zip and autoquick_src.zip files. The customagent_src.zip file includes a set of classes that define a custom automation agent that records user interaction with a Flex application. The interaction is then written out to a database. The autoquick_src.zip file records a user interaction and then plays it back. You can download these examples from the following location:

http://www.adobe.com/go/flex_automation_agent_apps

The sample files also include an XML file that the custom agents use to define their environment.

In addition to these samples, you can also download and run a testing-enabled version of the Adobe FlexStore application from http://www.adobe.com/go/flex_flexstore_automation.

The Automation Framework defines a single API that has two parts:

  • Component API -- Components must implement this API to support automation features. Developers can choose to put the code either in the main component itself or in a mixin class. Mixin classes implement this API for Flex components.
  • Agent API -- Agents use this API to communicate with the component API.

Component developers implement the component API for their component once and then the component is ready to converse with any agent. Agent developers implement the agent API for their specific feature or tool and it is able to work with any Flex application. For more information, see About the automation APIs.

Uses for agents

You can use agents to gather metrics information, to use automated testing, and to run applications at different locations at the same time.

Metrics

You might want to analyze how your online applications are being used. By gathering metrics information, you can answer the following questions:

  • What product views are most popular?
  • When do users abandon the checkout process?
  • What is a typical path through my application?
  • How many product views does a user look at during a session?

Automated testing

Maintaining the quality of a large software application is difficult. Verifying lots of functionality in any individual build can take a QA engineer many hours or even days, and much of the work between builds is repetitive. To alleviate this difficulty, automated testing tools have been created that can use applications and verify behavior without human intervention. Major application environments such as Java and .NET have testing tool support from vendors such as QTP and Segue.

By using the Flex automation API, you can:

  • Record and replay events in a separate tool
  • Manage communication between components and agents

Co-browsing

You might want to run the same application at different locations and view the application at the same time. By using the automation API, you can ensure that the applications are synchronized as users navigate through the them. User interaction at any location can be played at other locations and other users can see the action in real time.