2

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 Answers 3

3

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

Sign up to request clarification or add additional context in comments.

Comments

1

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

Comments

0

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.

1 Comment

Isn't it what I and Dimtri suggested?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.