Adding Assertions in the Add Assertion Panel
- Click the check mark in the Assertions column to add assertions to validate the responses.
- In the Response Body, Response Header, or Response Code tab:
- Select the assertion method from the drop-down list for the Response Body and Response Header.
- Click the gear icon in the Build Expected Value column to build an expression using the following fields:
- Select a value from the dropdown list in the Expected Value Source field.
- Enter a value in the Expected Value field.
- Select a parenthesis in the Group field, applicable only for numeric assertion methods such as AssertEqualNumeric.
- Select the appropriate operation in the Operation field.
- Click the plus (
) icon to add another row. Continue steps i to iv to form an expression. Click Save. The expression is displayed in the Expected Value Expression column.
- In Response Body, select the actual value type in the drop-down and do the following
- Click Fetch Response Details.
- If Static type is selected, enter the actual value path manually or click Select to view the response details. Hover and click plus icon in Response Body to use Jsonpath. Go to step 2.d.
- If RelativeJSON type is selected, click Select.
- Enter the final extraction key, path name and key manually or use the gear icon to Hover and click copy icon in Response Body to use Jsonpath. Path name is not mandatory.
- Select the source and enter the value or select value from dropdown based on the Source selection.
- Click the plus icon to add another row. You can add multiple rows to traverse the nested JSON and retrieve the Final Extraction Key. Click Save.
- Enter a customized message for the assertion failure.
- Click the plus icon to add more assertions or use the eraser to clear a row.
- Click Save.