Collections:
JSON Extractor - Capture JSON Data
How to use JSON Extractor to capture data from JSON message in JMeter?
✍: FYIcenter.com
The JSON Extractor allows you to capture data with a JSON expression match.
If a match is found, the matched data is capture in a given variable.
You can follow this tutorial to see how JSON Extractor works.
1. Copy and create a Test Plan called Azure-Echo-API-JSON-3.jmx.
2.Add a JSON Extractor to "Post a Valid JSON" sampler with the following JSON expression which looks for the content of "Name" property of the "TestRun" object:
Reference Name: TestRunName JSON Path Expression: $['TestRun']['Name'] Match No.: 1 Default Value:
3. Add a Debug PostProcessor after the JSON Extractor to "Post a Valid JSON" sampler.
3. Run the test plan with a Debug PostProcessor and open the "View Results Tree" listener.
4. Check the output of Debug PostProcessor under "Post a Valid JSON". You see the JSON data captured in "TestRunName" as "First Run".
The picture below shows you how to capture JSON data with a JSON Extractor:
Â
⇒ Accept Status Code 400 as Success
⇠Set Content-Type to application/json
⇑ Working With JSON Body Messages
⇑⇑ Apache JMeter Tutorials
2017-11-26, 2494👍, 0💬
Popular Posts:
How to generate user birthday dates? Test user birthday dates are frequently needed in testing appli...
How to generate MAC addresses? To help you to obtain some MAC addresses for testing purpose, FYIcent...
How to call JMeter command in a Windows batch file? I want to create a single batch job to run JMete...
How to valid UUID/GUID strings? In order to help your programming or testing tasks, FYIcenter.com ha...
How to generate MAC addresses? To help you to obtain some MAC addresses for testing purpose, FYIcent...