Assertions and Conditions: The Basics

Setting conditions on an API basis

You have total control over what is and isn't a pass, and the power to control what is and isn't expected.

Override default HTTP codes

In the example shown, we are overriding the default settings to set a HTTP 500 code as a pass and, therefore, a 200 code becomes a fail.



You want to validate that a call cannot succeed from a particular geography or a call with an OAuth scope of a particular kind always fails. In these scenario a Pass is operationally a problem.

Check a Response Body for a Specific String

You can examine the returned response body for a variable. For instance, if you are expecting the response body to have an access token, you can set a condition for the API call to return an error if there is none.

Set an Alert based on a timing issue

You can set an alert depending on the length of the call or a component of the call. For instance, you can set the response type to Passed but slow if the Total Latency is greater than 1000 ms.

Whatโ€™s Next

Next up, using variables and how to do it.