Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

JMeter assertion for a API response which contains [] or string "transaction"

How can we assert an API response which contains [] or "transaction"?

Jmeter Assertion should pass if it contains any of the below response
Response 1: [] (only empty square brackets)
or
Response 2: contains string "transaction" as part of response

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

The easiest is going for Response Assertion configured like:

enter image description here

It will pass in 2 cases:

  • when response body will contain []
  • or when response body will contain transaction

if response body won’t contain any of these – the assertion will fail.

More information: What Are JMeter Response Assertions?

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading