An API Monitoring (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 BlazeMeter 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:
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):
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
- Use variables to insert dynamic data and pass state between requests.
- Learn about all of the available assertion sources and comparisons.
- Manage configuration across realms with environments.
- Run API monitoring tests from a private location. You can use Radar agent to bridge BlazeMeter API Monitoring to private APIs not available over the public internet. Note that Radar agent is a wholly separate installation from Private Location agents, and is specific only to BlazeMeter's API monitoring function.
- Schedule your tests to run automatically or run them as part of your build and deployment process.
- Receive email, webhook, Slack, or PagerDuty notifications when your test runs complete (or just when they fail).
- Enable multiple locations to monitor your APIs from around the globe.
0 Comments