0
votes

Fetching data from one post response and reusing it for two other requests using JSON Extractor in Jmeter.

After reusing the response param for the first request the second request can't reuse the response and shows the default value used in JSON Extractor.

The values aren't coming in the second request, however it comes in the first request.

3

3 Answers

0
votes

Most probably your placement of the JSON Extractor is incorrect, JMeter PostProcessors obey JMeter Scoping Rules so if you have the JSON Extractor at the same level as other Samplers - it's getting applied to all samplers therefore after 1st request is being executed the variable gets overwritten with the default value.

The solution is to put the JSON Extractor as a child of the request which returns the data you want to extract, something like:

enter image description here

0
votes

You should put JSON Extractor level under request 1, and not after, in order to get the variable from response 1 only

This is because it's a post processor which is executed after each Sampler (request) in its hierarchy

0
votes

The rest service which are fetching parameters and JSON extractor should be kept as a child of the web-service from which parameters are fetched. This solved my issue.