This lesson will help you understand mabl's API Testing functionality.
Make sure you are comfortable with the following lessons:
Unlike UI tests that need to interact with a browser, API tests are performed at the message layer (e.g. http protocol) and therefore, run much faster than browser tests, completing in
seconds, not minutes. The mabl API test editor that lets you:
Use case: You can use the API testing capabilities in mabl to achieve the following:
There are two primary ways to create a variable within an API test:
You will typically use the variables panel to create variables with a default value which you can later override with different values that are passed to the API test from a datatable, or from a previous test run within the same plan.
Following the above approach, you can create as many assertions and variables as needed for each step of your API test. Thus, when you run the API test, if one of the assertions fails, then the test run will be marked as failed.
If you need to run an API test across multiple environments, you can use environment variables to pass environment-specific variables to an API test. Here is what you need to do:
You can perform data-driven API testing in a similar way to data-driven browser testing, using variables and a datatable to manage the test data outside of the test. There are three steps to it.
What did we learn?