JSON

Load Tester will automatically recognize JSON content in any HTTP request body with an appropriate Content-type header or any form field that successfully parses as JSON. When this happens, each JSON element will become a configurable name-value pair field in the Fields View.

 

 

Whenever Load Tester’s Application State Management tool runs, it will search for incoming name-value pairs that have matching outgoing name-value pairs. This search works only for JSON numbers and strings, and only for identical matches. When the ASM tool detects a match, it will automatically configure the test case to transmit the value it received.

 

The screenshot below shows such a segment of JSON content. The ‘address_id’ and ‘address’ fields in this test case were provided by the web server in a separate response (not shown), extracted, and routed dynamically into all subsequent requests. For many users, this will completely automate test case development. Some users will need to add some custom configuration to simulate complex application logic.

 

 

Currently, extraction of JSON content is performed using specialized regular expressions. Load Tester may choose the wrong element in some cases, for example, when identically-named elements are presented in arbitrary order, or when correct selection of an element depends on a complex query over the available data. Please understand that while other types of auto-configuration performed by Load Tester are highly reliable (so much so that we recommend that test case developers completely ignore automatically configured fields), the correctness of auto-configuration in JSON content can not in general be guaranteed.

 

If you have a test case that you feel Load Tester should be able to automatically recognize, please consider submitting a copy of that test case on our support tracker.

 

Finally, there may be cases where Load Tester will not notice JSON content inside a request. In particular, the content may be hidden inside a query parameter or form field, or the content-type header may for some reason indicate that the content is something other than JSON. However, the user can mark any field as JSON content by using the “Parsers” tab in the field edit dialog.