Known is a drop; Unknown is an Ocean

1. Introduction

Adobe Flex is a software development kit released by Adobe Systems for the development and deployment of cross-platform rich Internet applications based on the Adobe Flash platform. Flex applications can be written using Adobe Flex Builder or by using the freely available Flex compiler from Adobe.

Developers use two core languages to create Flex applications. The first core language is MXML, the Macromedia Flex Markup Language, which includes a rich set of XML tags that allows developers to layout user interfaces. Some MXML constructs allow you to call remote objects, store data returned in a model, and customize your own look and feel to MXML components.

The second core language for Flex development is ActionScript 2.0, which is similar to JavaScript. ActionScript elements are coded inside MXML pages, has robust event handling capabilities to allow the application to respond to dynamic user interactions. Unlike JavaScript, since ActionScript runs inside the Flash plug-in there is no need to rewrite several versions of the same code to support different browsers.

The Flex server is responsible for translating the MXML and ActionScript components into Flash byte code in the form of .SWF files. The SWF file is executed on the client in the Flash runtime environment. The Flex server provides other services such as caching, concurrency, and handling remote object requests.

2. LoadRunner 9.5

VuGen allows you to create Vusers that emulate the protocol suite provided with the Flex 2 SDK.


RIAs are lightweight online programs that provide users with more dynamic control than with a standard web page. Like Web applications built with AJAX, Flex applications are more responsive, because the application does not need to load a new Web page every time the user takes action. However, unlike working with AJAX, Flex is independent of browser implementations

such as JavaScript or CSS. The framework runs on Adobe's cross-platform Flash Player.

3. Script Correlation

Correlating Flex Scripts


Flex applications often contain dynamic data, data that changes each time you run the script. For example, the object name may change from run to run.


When you record a Vuser script, VuGen records a set of data and argument values. When you replay the script, however, the server may reject these arguments and issue an error. This error could be the result of dynamic data that is outdated and no longer accepted by the server.

To overcome this, you apply correlation to your script:


Save the server response in preparation for extracting the required values.

Extract the required values from the server response.

Save the values to a parameter.

Use those parameters as input to your Flex requests.


These errors are not always obvious, and you may only detect them by carefully examining Vuser log files. If you encounter an error when running your Vuser, examine the script at the point where the error occurred. Often, correlation will solve the problem by enabling you to use the results of one statement as input for another.

To perform correlation:


1 Locate the step in your script that failed due to dynamic values that need correlation.


Use the Replay Log to assist you in finding the problematic step.




2 Identify the server response with the correct value in one of the previous steps.


Double-Click the error in the Replay log to go to the step with the error. Examine the preceding steps in Tree View and look for the value in the Server Response tab.



3 Save the entire server response to a parameter.


Before you extract the value, the entire server response should be saved to a parameter as follows:


Right-click the step node (in the left Action pane) corresponding to the server response containing the value and select Properties.

In the Flex Call Properties dialog box, type a Response parameter name.

Click OK to save the new parameter name.


4 Save the original server response value to a parameter.


In the Replay Snapshot: Response Data, right-click the node above the value (for example, string), and select Save value in parameter.



In the XML Parameter Properties dialog, specify a parameter Name. You will use this name in subsequent steps.


Click OK. The script will now contain a new function, lr_xml_get_values.


5 Insert the parameter in the subsequent calls.


In VuGen edit view, beginning with the call that failed, replace the value in all subsequent calls to the object with the parameter that you defined:


Right-click the step node (in the Action pane) corresponding to the failed call and select Properties.

Locate the argument that required correlation.

In the Value box, type the parameter name in curly brackets, for example, {ParamValue_string}.



Click OK.


6 Run the script.


Make sure that VuGen properly substitutes the argument value with the parameter value that you saved.

Courtesy: HP