To extract values from a Rich Internet Application (RIA) response, such as JSON, XML or AMF:
Find the response containing data you want to extract. To do this, select the request that returns the needed response and then switch to the Response tab.
Switch to the Response Body tab at the bottom of the editor. It shows the tree-like structure of the response data.
Select the parameter whose value you want to extract.
In the Variable column, enter the name of the variable that will store the extracted value, or click and select the needed variable in the dialog. Remember to specify the
@prefix, that is,
Use existing project and scenario variables only if they do not pass other data. Otherwise, LoadComplete will replace the data they contain with the extracted values during the test run.
Select File | Save from the LoadComplete main menu to save the changes.
Once you extract a value from a Rich Internet Application (RIA) response, you can:
Validate the extracted value to make sure that the server returns correct data. To do that, create a validation rule that will compare the extracted value against a baseline value.
For step-by-step instructions, see Validating Response Contents.
(Optional) Modify the extracted data if needed. See Modifying Correlation Data.
Pass extracted data to subsequent requests.
You can use the extracted value only in requests that follow the response from which you extract the value.
If the structure of a response returned by the server during the test run differs from the structure of the same response obtained during test recording, LoadComplete will fail to retrieve parameter values from the response. It will not save the values to variables and the correlation rules will fail.
For step-by-step instructions, see Using Variables in Requests.
If you use the extracted data for data correlation, LoadComplete will wait for the server to return the response containing the needed value until the correlation timeout expires. See About Data Correlation.