jsonjmeterextractor

How can i extract the order id from below stringy json in jmeter?


How to extract the order id from below code

{"status": "OK", "data": {"ExecutionComplete": true, "Result": "{\"status\": \"OK\", \"data\": {\"orderId\": \"order_JUDoycmj5SoERg\"}, \"statusCode\": 200}", "JobState": "SUCCESS"}}

Solution

  • Go for 2 JSON JMESPath Extractors:

    1. First to get Result attribute value from the response

      enter image description here

    2. Second to get orderId attribute value from ${Result} JMeter Variable

      enter image description here

      enter image description here

    3. Once done you will be able to refer the extracted value as ${orderId} where required

    More information: The JMeter JSON JMESPath Extractor and Assertion: A Guide