How to create API test case
An API Test Case is a structured validation scenario designed to test the functionality and behaviour of backend services. It validates API endpoints by sending requests and verifying responses such as status codes, headers, and response data to ensure the service works as intended.
Steps to Create a API Test Case
Click the Create New Test Case button to start a new validation scenario.

Click "Add Step", then type “/” inside the step field. From the dropdown menu, choose Test Case Type and select API. This allows you to configure structured API validation steps without writing manual code.

Select the required HTTP Method (GET, POST, PUT, DELETE, PATCH).

Enter the Request URL. You can use variables inside the URL if needed.

Use the available tabs to configure the request:
In Params, add query parameters as key-value pairs.
In Authorization, select the required authentication type such as Bearer Token, Basic Auth, API Key, OAuth, JWT, etc.
In Headers, add the necessary request headers.
In Body, choose the required body type such as JSON, Form Data, Raw, x-www-form-URL encoded, or Graph, and provide the payload if needed.
In Variables, manage Local, Runtime, and Global variables.
In Extractions, define rules to capture values from the API response for use in subsequent steps.
In Pre-request Script, add logic that should execute before the request is sent.
In Tests, define validations to verify response status codes and response data.
Enter the step description in simple English to clearly describe the API validation scenario.
To reuse an existing parameter, type
${to open the parameter dropdown and select the required variable. To create a new parameter, refer to the Create New Parameter section for guidance.

Once all steps and configurations are completed, click Save to store your test case in the dashboard.
Run the created API test case using either:
Manual Mode for step-by-step validation.
Automation (Walnut AI) Mode, where Walnut AI automatically sends the request, resolves parameters, processes variables, performs validations, and generates structured execution results.

To understand the details of running your tests and how the system handles changes, refer to the documentation on Execution & AI Healing.
Last updated

