I’m currently testing a web application which outputs json. I want to make sure that the JSON is valid. I do not want to validate its content. How can I implement a assertion in jmeter to make sure that the json response is valid?
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use beanshell assertion, jsr223 assertion or bsf assertion if you want to use groovy:
and parse the response using some json parser:
how to parse json using groovy
http://mrhaki.blogspot.com/2011/04/groovy-goodness-parse-json-with.html
Jmeter will provide to your script the previous sampler response as a script variable.
Note that this can impact performance of your test plan as it’s rather costly.
Regards