Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

How to fail a test scenario using a matching string from response body

mdsheeraz
mdsheeraz Posts: 25

Hi Team,

I am getting test scenario passed in the CTP since it is considering the http response code as 200 and returning PASS.
But the response we are getting is failure in the response body so the requirement is to make that test scenario fail by matching the string from response body.

For example: Response body
{"success":false,"message":{"strings":["An error occurred while running Scenario: ",""],"values":["There must be one primary domain in the Scenario."]}}

Answers

  • jakubiak
    jakubiak Posts: 813 admin

    You can add a JSON Assertor to the response body of your client, and configure it to fail when the response body contains the failure content.