5

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 1

5

For example you have the following response:

JSON Response

And you need to extract John from it.

  1. Add JSON Extractor Post Processor
  2. Configure it as follows:

    • Reference Name: anything meaningful, i.e. name
    • JSON Path Expressions: $.name

      JSON Extractor example configuration

  3. That's it, you now have ${name} JMeter Variable with the value of John

    Variable from JSON Response

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

Response assertion for a JMeter Variable


1
  • Excellent.... !!. I hope this will help to other Jmeter learners as well. cheers..!
    – lak
    Commented Feb 10, 2017 at 16:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.