Note: This feature is currently in Beta and may contain bugs or issues. We appreciate your feedback and understanding as we work to improve its functionality.
Accessing the API Step
The API step can be added via the + button, just like other testing steps.
Once selected, the API step expands to full-screen view, where you’ll find the following fields:
Method: Options include GET, POST, PUT, DELETE.
URL: The endpoint URL.
Tabs: The API step contains several tabs:
Headers
Parameters
Payload
Assertions
Use Response Data as GLOBALS Variable: A checkbox with an instructional label for using response data in subsequent steps.
Tabs and Fields Overview
1. Headers Tab
This tab allows you to define dynamic name-value pair fields for headers. Click the ADD NAME-VALUE PAIR button to add more pairs.
2. Parameters Tab
Similar to the Headers tab, you can add name-value pair fields for parameters using the ADD NAME-VALUE PAIR button.
3. Payload Tab
The Payload tab includes the following fields:
Payload Type: A dropdown to select the payload type. Options include:
JSON
Text
JavaScript
HTML
Payload Content: A textarea field where you can enter the payload.
The preferred JSON type comes with a format checker.
An expected working example format is as follows:
{
"completed": false,
"title": "delectus aut autem",
"id": 1,
"userId": 1
}
4. Assertions Tab
The Assertions tab lets you validate the API response using different assertion types. The ADD ASSERTION button allows you to add assertions with the following options:
Body Text:
Assertion Types: Equals, Does not equal, Contains.
Value input field for expected text.
Status Code:
Assertion Types: Equals, Does not equal.
Input field for expected status code value.
Header:
Header Name input field.
Assertion Types: Equals, Does not equal, Contains.
Header Value input field.
Body JSON:
Key input field for the JSON key.
Assertion Types: Equals, Does not equal.
Value input field for the expected value.
Note: When the response body contains an array of objects, use the appropriate index notation (e.g., [0].id where 0 is the first index).
Sending the API Request
Once the API step is configured, click the SEND button. The backend performs a dry-run test, and the following tabs will appear:
Response Tab: Displays the response status and time.
Response Body Tab: Shows the full response body.
Response Headers Tab: Shows the response headers.
Response Assertions Tab: Indicates which assertions passed (green text) and which failed (red text).
Using GLOBALS Variables Across Steps
The GLOBALS variable feature allows you to use data from one API step in subsequent steps. To enable this:
Check the "Use Response Data as GLOBALS Variable" checkbox in the API step configuration.
An instructional label will appear, explaining how to use the specific response data based on its API step id and type of response.
Example: To access object properties, use #{api-in6mdd.id}, or for nested array objects, use #{api-in6mdd[0].id}
Using GLOBALS in Other Visual Steps
You can use the GLOBALS variable from an API step in other visual steps (e.g., "Check Step"):
After selecting the element locator in the Check Step, you’ll see an option to perform a Content Comparison.
Select Expect a specific text, and input the corresponding GLOBALS variable to compare against the element's content.
Using GLOBALS in Subsequent API Steps
You can also use the GLOBALS variable within other API steps for fields in:
Headers
Parameters
Assertions (with screenshot example)
Payload
Ensure that the correct structure is followed when referencing the GLOBALS variable, as described in the instructional label under each API step.