Test Step - API
API steps enable programmatic interactions with external services through HTTP requests, data assertions, and integration checks.
Overview
API steps allow you to send HTTP requests (GET, POST, PATCH, DELETE, etc.) to RESTful or SOAP endpoints as part of your automation scenario. They are ideal for data setup, validation, service-level health checks, and integration with non-browser systems.
Unlike UI steps, API steps do not require a browser session and execute faster with less overhead. They can be combined with UI steps within the same test case for hybrid scenarios.

Request Configuration
Each API step consists of a request configuration including the target URL, HTTP method, headers, query parameters, and body payload. You can reference test data values and environment variables directly within the request configuration.
Set the HTTP method and endpoint URL. Use environment variables for hostnames to keep steps portable across environments.
Configure headers (e.g., Content-Type, Authorization) as needed. Sensitive tokens should be managed through environment variables, not hard-coded.
Provide the request body in JSON, XML, or form-encoded format. Use test data placeholders like {{employeeId}} to inject row-specific values.
Optionally define pre-request scripts to transform data or compute dynamic values before the request is sent.
Practical Tips
- Store all environment-specific URLs and credentials in environment variables, not in step code.
- Use the built-in variable syntax {{paramName}} to reference test data columns directly in the URL, headers, or body.
Response Validation
API steps automatically capture the response status code, headers, and body. You can define assertions to validate the response meets expected criteria.
Assert the expected HTTP status code (e.g., 200, 201, 204) to confirm the request succeeded.
Validate response body fields against expected values or patterns using JSONPath or XPath expressions.
Extract values from the response (e.g., a newly created record ID) and store them as variables for use in subsequent steps.
Practical Tips
- Always assert both the status code and at least one meaningful response field to catch partial failures.
- Avoid logging full request/response payloads in production to prevent sensitive data exposure.
Data Binding & Variables
API steps integrate with the test case data table and environment configuration. Each row in the test data provides a distinct set of parameter values for the API request.
Bind test data columns to request parameters using {{columnName}} syntax.
Use response extraction to capture dynamic values (e.g., session tokens, record IDs) and pass them to downstream steps.
Leverage the same data templates and bulk editor available for UI steps to manage API test data efficiently.
Best Practices
Follow these guidelines to build reliable and maintainable API steps.
Practical Tips
- Keep API steps focused on a single interaction or assertion — one step, one API call.
- Use meaningful step names that describe the API intent (e.g., "Create Employee via API" rather than "API Step 1").
- Test API steps with both happy-path and error-case test data to ensure robust error handling.
- Combine API setup steps with UI validation steps to create end-to-end hybrid scenarios.