A test Passes if all the assertions pass. A test Fails if any assertion fails, or another error is encountered like a network connection problem or a reference to an undefined variable.
After creating a test, click Add Request to create a new HTTP request template. The template is pre-configured with some sample data:
Our sample URL is guaranteed to return a
200 OK status code. Later on, when building your own tests, you can define requests with your own methods, URLs, headers, parameters, or body content.
With a request added, we can move on to defining expected response data. Click on the request to expand it, and view its details. Select Assertions, and add the following assertions (we've created one for the status code automatically):
The assertions are evaluated after the request is executed for every test run. If any assertion fails, the test will fail. For your tests, you can create assertions that check response time, JSON or XML content, HTTP response headers and more.
Click Save & Run to start a new test run. The request will be executed and upon completion, each assertion will be checked. If everything checks out, you should see that the test run Passed. Select the test run from the results list to view the full HTTP request, response and test output.
Everything is going to be 200 OK™