Assertions allows you to validate the test case response in a test run. If all the assertions of a test cases pass in a test run then test case will be marked as passed otherwise the test case will be marked as failed. Assertions can be defined in the Response Validation tab for a test case.
...
- Equals
This operation returns true when actual value is equal to expected value. This operation first cast the actual value to string then performs a string comparison. - Does not equal
This operation returns true when actual value is not equal to expected value. This operation first cast the actual value to string then performs a string comparison. - Is empty
This operation returns true when the actual value is equal to blank string. - Is not empty
This operation returns true when the actual value is not equal to blank string. - Contains
This operation returns true when the expected value is a substring of actual value. - Does not contain
This operation returns true when the expected value is not a substring of actual value. Matches Regular Expressionwith regular expression
This operation matches the actual value against the regular expression specified in Expected Value field. e.g. For email regular expression, you may specify the expected value as shown below:Code Block language js title Email Regular Expression /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
- Is a number
This operation returns true when the actual value is a number or can be casted to a number. - Is a boolean
This operation returns true when the actual value is a boolean value or boolean string value "true" / "false". - Equal to number
This operation returns true when both the expected and actual values can be casted to number and are equal. - Does not equal to number
This operation returns true when both the expected and actual values can be casted to number and are not equal. - Less than
This operation returns true when actual value is less than the expected value specified. Both values are first casted to Number. - Less than or equal to
This operation returns true when the actual value is less than or equal to expected value specified. Both values are first casted to Number. - Greater than
This operation returns true when the actual value is greater than the expected value specified. Both values are first casted to Number. - Greater than or equal to
This operation returns true when the actual value is greater than or equal to the expected value specified. Both values are first casted to Number. - Call Default Validator
This operation calls the Default Validator to check the validity of the response body. For this assertion to work, you need to specify the Expected Response Body in the 'Expected Body' sub-tab. - Call Default Schema Validator
This operation calls the Default Schema Validator to check the schema of the response body. For this assertion to work, you need to specify the Expected Response Schema in the 'Expected Schema' sub-tab. - Call <Custom Validator>
This operation calls the Custom Validator of your choice to check the validity of the response body. You can optionally specify the Expected Response Body in the 'Expected Body' sub-tab.
...