This topic describes how LoadComplete supports the JSON format.
JSON is a format used for serializing and transmitting structured data over a network connection. It is typically used for exchanging structured data between a server and web applications.
LoadComplete can decode JSON. This means that with LoadComplete, you can perform load testing of applications that use this format for their browser-server communication. LoadComplete supports recording and playing back of JSON requests and provides you with access to individual data values that are sent to or received from the server. So, you can easily parameterize JSON requests.
Also, LoadComplete supports automatic correlation of JSON request and response data. See About Data Correlation.
To record JSON, you do not have to make any special preparations. You can record traffic in the same way as you record HTTP traffic (see Recording User Scenarios).
Content-Type attribute of JSON requests is application/json:
For each parameter, LoadComplete displays the following information:
The parameter name.
LoadComplete obtains the parameter name from the JSON stream. The parameters whose names LoadComplete fails to retrieve are reported as
Array items are displayed as
|Type||The parameter type.|
The parameter value as it was during the scenario recording.
If a parameter of the String type is empty, LoadComplete will not display anything in the cell.
If you see that a parameter has the String type and the Value is nil, this means that the parameter contains the string “nil”.
|Variable||In responses, you use variables to store parameter values that LoadComplete extracts during a test run. You can then use those values in subsequent requests.
In requests, you replace the recorded parameter value with the value of the specified variable. This can be either a value extracted from a previous response, or a value that LoadComplete generates or loads from an external file.
|Path||The path to the parameter in the parameter tree, starting from the root element.|
The key benefit of accessing data values passed in JSON streams is that you can change them in your tests. This helps you pass information from earlier requests to further requests with ease. The entire procedure is very simple:
Open your scenario for editing.
In the scenario editor, find the request that obtains data from the server.
For step-by-step information on parameterization, see Parameterizing Rich Internet Application Traffic.
|Note:||LoadComplete does not change the request structure. You can change parameter values, but you cannot create or delete parameters or change their type.|