Skip to main content

How to add an API Call step?

You can add API calls as steps in your automated Test Case.

Jihed Othmani avatar
Written by Jihed Othmani
Updated over a month ago

What You'll Learn

  • How to integrate API calls into your Test Case

  • Setting up different types of API requests (GET, POST, PUT, DELETE)

  • Configuring request parameters, headers, and authentication

  • Best practices for API testing in Thunder

Before You Start

  • Make sure you have an existing Test Case ready

  • Familiarize yourself with the API endpoints you'll be using

Step-by-Step Guide

  1. Navigate to Your Test Case: Open the test case where you want to add the API call

  2. Create a New Step: Click the "Add a new step" button

  3. Choose API Call Type: From the "Step description" dropdown menu, select "API Call"

Set Up Your Request

  • Method & URL

    Choose your HTTP method and enter the API endpoint

    Example: https://api.example.com/v1/

  • Parameters

    Add query parameters using the "Add Row" button

  • Headers

    Set up necessary headers like:

    Content-Type: application/json

  • Authentication

    Configure your auth method (Bearer token, Basic Auth, etc.)

  • Request Body

    Add your JSON payload for POST/PUT requests

Save Your Changes: Click "Add" to save your API call configuration

Execute your test case: Click “Execute” to execute your test case and see the result of the API call

Common Use Cases

Here are some practical ways to use API calls in Thunder:

  • Data Setup: Create test data via POST requests before running UI tests

  • Backend Verification: Use GET requests to verify data after UI interactions

  • Test Cleanup: Implement DELETE requests to clean up test data

Did this answer your question?