Runscope Documentation

API Monitoring and Testing: Getting Started

A Runscope API test is a group of one or more HTTP requests executed sequentially to evaluate the uptime, performance and correctness of an API. For each step in the test, you can define Assertions to validate response data and Variables to extract data to be used in subsequent requests.

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.

Tests can be run from the cloud or behind your firewall against any public or private API. When a schedule is configured, tests can be used for ongoing monitoring. After a test run completes, notifications can be sent via email, webhook, PagerDuty, Slack, and more.

Create Your First Test

If you haven't yet, sign up for your free Runscope account. After completing the tutorial, start by creating a new test (or API Tests > Create Test). You can name it anything you like.

1. Add a Request Step

After creating a test, you'll see an HTTP request step with a sample URL has been automatically created and added to your test:

New HTTP request

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.

2. Define Assertions

With a request step 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):

Sample API test assertions

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.

3. Run Your Test!

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.

Next Steps

Next: Assertions →