Adding Flex Automation Capability

Document created by Chris Sommerstad Employee on Jul 20, 2017
Version 1Show Document
  • View in full screen mode

To enable automation through SOASTA, we add Action Script functions for each of the events that we want to automate in testing.

Note: Refer to Adobe Action Script documentation for Action Script conventions.

You can download an archive of this test application including the compiled object and its code, or access and download the individual source files as they occur in Find Out How below.

  

  1. Start by adding the following two helper functions for locating the Flex components by id in a file named testAPI.as.

 

  1. Next, add a function to select a value in the combo box by its label.

  1. Then add a function to click the button.

 

  1. Add a function to change the value of the text input.

 

  1. Expose all of the automation functions that were just added to JavaScript with the following code in testAPI.as.

 

  1. Then we inlcude testAPI.as in our mxml file and add the call to registerTestCallbacks in the onInit handler.

 

  1. At this point, the Flex component is ready to be tested by SOASTA. Compile the above .mxml and .as files to create FlexAUT.swf. Add the Flex object to an html page with an id of FlexAUT.

  1. Create a target to test the HTML page and then create a clip that uses that target.

In the Clip Editor, add "flexAction" actions to invoke the automation methods defined above.

 

  • For the selectByLabel and setTextInput functions, which both have 2 parameters, those parameters are separated by an '@' symbol.

Attachments

    Outcomes