3

I'm new to JMeter and I'm probably missing something quite simple...

Note: I'm using a json add-on as well.

After making a request, I extract a value from the response. If I check the view results I'm able to see the correct value in the variable I created.

-Initial extraction of value- My Initial response

-how I tried to use my new value for a new request- My Second Request Using the Variable

If I try use the variable in another request, I receive an error because the variable is now the default value.

Default value being used for variable

What am I doing incorrectly that makes the second post request to use the default value and not the value it captured (if I did that correctly).

Thanks

2 Answers 2

3

JSON Path Extractor is a Post Processor. It is not a Sampler. It should be the child element of the first request 'Create Order' in your test plan if you are going to extract from the 'Create Order' response. If it is in same level with other requests, the post processor will be executed for each and every samplers in the same level. That is why, You are able to see the value for the first time. Now Post processor tries to extract the value from the Debug Sampler as well. As Debug Sampler does not match your JSON extract condition, It sets the default value.

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

2 Comments

As you stated, in simple terms... I moved the JSON path extractor into the create order and everything worked correctly.
You also multiple have View Results Tree. You just need one for the Test Plan. You can accept this as answer by clicking the tick mark if it had clarified your question.
0

2 years later (March 2018), with Jmeter version 4.0, solution it's the same.

With the new interface, simply by dragging the json extractor on the http request, the json is limited to perform the extraction operation on it, maintaining the results.

enter image description here

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.