How to Use Http request/JSON extractor(using Jmeter Variable) in Jmeter with Response assertion(using Jmeter Variable). better to provide with Example?
1 Answer
For example you have the following response:
And you need to extract John
from it.
- Add JSON Extractor Post Processor
Configure it as follows:
That's it, you now have
${name}
JMeter Variable with the value ofJohn
If now you want to validate its value you can add a Response Assertion and configure it like:
- Apply to -> JMeter Variable ->
name
- Pattern Matching Rules:
Equals
- Patterns to Test:
John
- To learn more about JSON Path check out this Getting Started article.
- To see some advanced use cases (conditional select, matching multiple values in a single request, working with JSON Arrays) refer to Advanced Usage of the JSON Path Extractor in JMeter guide.
-
Excellent.... !!. I hope this will help to other Jmeter learners as well. cheers..!– lakCommented Feb 10, 2017 at 16:31