Im new to jmeter and wanted to extract the array data from json object
i have a Json as below
{
"error": false,
"data": {
"seq": [
"71128dfa",
"cbfda925",
"9d9bfa68",
"0ca86cf2",
"8bc3cfa7",
"4ea9aee3"
],
"request_id": "1db799cf-8f2b-4982-a23e-b2fb95b609b9"
}
}
i need to get the data which is under seq array
2
Answers
You can use Json Extractor to extract it
you need to pass the json path expression to retrieve it
Since JMeter 3.1 it’s recommended to use JSR223 Test Elements and Grooovy language for scripting so I would recommend switching to JSR223 Post-Processor
If you want the JSON Array which lives under
seq
attribute you can extract it using the following code:You will be able to refer the extracted value as
${seq}
where required.Demo:
More information: