Home > Back-end >  Jmeter passing value from one response to another request
Jmeter passing value from one response to another request

Time:11-18

I am trying to parse the array value from the response of one request and pass it to another request.From one api I get the response as : {"id":95,"email":"[email protected]","firstname":"test","lastname":"rider","phoneNumber":"9999990002","phoneNumberVerified":true,"emailVerified":true,"address":{"address":"2400 Perimeter Rd, Auburn, WA 98001, USA","zipCode":"98001"},"dateOfBirth":"2000-10-05","gender":"UNKNOWN","fullName":"test rider","enabled":true,"isDriver":false,"avatars":[{"id":131,"type":"RIDER","active":true}]}

I need to use the id from the avatars array in the next request .But ,I am unable to do so using the pre and post processors .

I have tried using the JSON Extractor,JSR223 Processor and RegEx extractor but to no use.

CodePudding user response:

The simplest way is to use Reg. expression extractor with the below expression:

"avatars":[{"id":(. ?),

CodePudding user response:

I believe enter image description here

More information: How to Use the JSON Extractor For Testing

  • Related