0
votes

I have a POST request that is similar to this:

https://abc.qa.net/teachers

The response of above request is similar like this:

teacherUuid":"eb57eb97-0a9d-4b51-a237-1f6610983167"

Then, I have a PATCH request that is similar to this:

https://abc.qa.net/teachers/{teachersUuid}

Problem Statement:

I want to make two request in Jmeter. The first request (POST) generates a new id for me and then I want to use the same id to make second request (PATCH) in Jmeter. Note that, the second id will be passed via URL. How I can achieve this functionality in simple way?

1
Please read Under what circumstances may I add “urgent” or other similar phrases to my question, in order to obtain faster answers? - the summary is that this is not an ideal way to address volunteers, and is probably counterproductive to obtaining answers. Please refrain from adding this to your questions. - halfer

1 Answers

0
votes
  1. Your response body seems to be JSON therefore JSON Extractor is your friend. Add JSON Extractor as a child of the first request and configure it as follows:

    • Names of created variables: teachersUuid
    • JSON Path Expression: $.teachersUuid (you may have to amend it according to your response data, check out Json Path Getting Started section to learn more
  2. Refer the extracted value as ${teachersUuid} where required, i.e. amend Path section of your 2nd HTTP Request sampler to look like:

    /teachers/${teachersUuid}
    

More information: