CodeGirl
CodeGirl

Reputation: 59

How to read a value from a response that comes as an array in Jmeter

I have an api response coming as an array. [{"data1":763,"data2":"jhgf"}] How can i read a single value from this and assign it to a variable in jmeter. This value is required to pass on to the next request.

Upvotes: 0

Views: 130

Answers (1)

Dmitri T
Dmitri T

Reputation: 168072

Which exact value?

You can use JSON Extractor for parsing the response and if you want 763 - use the following JsonPath expression:

$..data1

enter image description here

if you want jhgf - the relevant JsonPath expression will be correspondingly

$..data2

More information: How to Use the JSON Extractor For Testing

Upvotes: 1

Related Questions