I am getting Json as a response. Instead of using multiple jsonPath_assertion I want to check it in single beanshell. Each time I am getting Response with different values.
I would suggest using JSR223 Assertion and Groovy language instead.
Groovy has built-in JSON support so you will be able to use JsonSlurper class to parse the response like:
def json = new groovy.json.JsonSlurper.parseText(prev.getResponseDataAsString())
// do what you need here
Besides Groovy performs much better than Beanshell and it is recommended to use it for scripting in JMeter. See Groovy Is the New Black for more information.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With