Use the API Test Editor to create requests, validate responses, and configure scripts and auth settings for your mabl API test. This article explains the different parts of the API Test Editor, including:
The API Test Editor
The step builder
Click on the + Add step button to create a new API step. The API Test Editor loads a step builder on the right side, which consists of the following sections:
- Request details - configure and send an API request
- Response - review the response of an API request
- Validation and variable assignment - add assertions, create variables, or add a post-request script using the response of an API request
The step builder
API flows
If you want to reuse a sequence of API steps across different steps, create or import a flow.
The variables panel
Expand the variables panel at the bottom of the window to view the current and default values for variables in the test. At a minimum, the variables panel shows the base API URL as api.url
. Depending on the test configuration, the variables panel may also show:
- Environment variables
-
Credentials -
api.credentials.username
andapi.credentials.password
- DataTable variables with the values for the selected scenario
- Test-generated variables
The Current field shows the value of a variable in the current editing session. Current values do not persist to the next editing session.
Environment and DataTable variables only persist to subsequent editing sessions if they have a default value. We suggest setting defaults on the variables used in the test to make it clear which variables the test relies on.
The variables panel
Test properties
In addition to configuring individual request steps, you can edit test properties to apply authentication or scripts to every step in the test.
Click on the "Edit test properties" pencil to bring up the edit test modal.
Options for running steps
You can run the entire test or run individual steps in the API Test Editor:
- To run the entire test, click on the play button in the top left corner.
- To run individual steps, click on the Send button in the Request details panel.
For more information on running API tests locally and in the cloud, click here.