Recently, we faced a situation wherein our performance test, we need to put an assertion on one of the response body parameter field values. We googled about it but could not find any straightforward answer.
I posted the question in StackOverflow as well but unfortunately could not found the solution from there also. Later, got a solution from one of my colleague who has expertise in Jmeter.
https://stackoverflow.com/questions/66989810/jmeter-less-than-or-greater-than-assertion-in-jmeter-assertion-on-api-respon
So, to put an assertion in the response body parameter, first, you need to find out that value from the response body. So for this purpose, we first added a Post -Processor: JSON -Extractor.
Inside this, we first fetched the value and stored this value inside a JMeter variable:
queryTime = $.metadata.queryTime
No comments:
Post a Comment