Step 3: Adding Tests for Response Fields
You can add tests to check whether the API response data matches what you expect for each test run.
To add API tests:
Switch to the Add Tests tab.
In the Pattern field, specify the response field using an object pattern. Examples include
page.name
,users.length
,users.0.name
,users.*.name
.Click Test Pattern to automatically fetch the value from the response data. You can also manually enter a value if needed.
Example 1: Accessing from an array
Example 2: Accessing from an object
Use the Add Test option to include more tests for different response fields as needed.