Best Practice: Streamlining API Test Orchestration with "Dynamic Values" in Apidog

Passing data efficiently between test steps is crucial in automated testing. Traditional methods are often time-consuming and error-prone. Apidog's "dynamic value" mechanism automates data passing, enhancing API test orchestration and reducing maintenance efforts.

Oliver Kingsley

Oliver Kingsley

18 May 2025

Best Practice: Streamlining API Test Orchestration with "Dynamic Values" in Apidog

When orchestrating automated API tests, efficiently passing data between test steps is crucial. Traditional methods often involve manually copying and pasting data or configuring complex scripts, which can be time-consuming, error-prone, and difficult to maintain. Apidog introduces a "dynamic value" transmission mechanism to address these challenges.

What is Test Orchestration?

In the realm of software development and quality assurance, the coordination and automation of various testing activities play a pivotal role in ensuring the reliability and functionality of applications. Test orchestration, a critical aspect of the testing process, involves the systematic arrangement and execution of test cases, scripts, and procedures to achieve comprehensive and efficient testing outcomes.

Test orchestration serves as the backbone of the testing process, enabling teams to manage, schedule, and automate testing activities across multiple environments and platforms. By orchestrating tests effectively, organizations can enhance testing coverage, reduce manual efforts, and accelerate the testing cycle, ultimately leading to faster releases and improved software quality.

The Biggest API Test Orchestration Challenge

The most significant challenge in API test orchestration is efficient data management. This challenge encompasses several critical aspects:

1. Data Dependencies

2. Dynamic Data Handling

3. Scalability

4. Maintainability

The Power of Apidog's Dynamic Values

Dynamic values at Apidog act as a flexible "bridge", capturing the data of specified "upstream" test steps(pre-step) and inserting them into the request parameters of "downstream" test steps (current step). This mechanism ensures that API test cases adapt seamlessly to data changes across different scenarios, eliminating manual data transmission and significantly reducing the potential for errors.

Setting Up Dynamic Values in Apifox:

1. Define Parameter Values:

Retrieve pre-step data at Apidog

2. Select the Upstream Data Source:

Choose from which pre-step to extract the data

3. Use JSONPath for Precision(optional):

Write JasonPath expressions to extract data

4. Process Data if Needed(optional):

Add aditional processing function to encrypt the data

For more information concerning setting up Dynamic Values at Apidog, please visit: Transfer Variabiles In Test Case.

Practical Use Case: Using Dynamic Values for Data Passing in API Test Orchestration

Imagine you're testing an online API for a pet store. One automated test task is to confirm that a new pet can be successfully added and its information queried. This involves two steps:

Add New Pet:

Query Pet Information:

API Test Orchestration without Dynamic Values:

API Test Orchestration with Dynamic Values:

This streamlined process requires no manual intervention, significantly enhancing efficiency and reducing errors.

Step-by-Step Implementation in Apifox

Step 1: Extract Parameters

In the "Add a new pet" step, the response structure might look like this:

{
    "code": 0,
    "data": {
        "id": 1,
        "name": "Golden Retriever",
        "photoUrls": ["http://dummyimage.com/336x280"],
        "status": "sold"
        // Other information...
    }
}

Locate the id value within the data object.

Step 2: Reference Dynamic Values

In the "Query pet information" step:

1. Enter the test step details page by clicking on the step.

Click the test step to enter the step customization page

2. Click the "magic wand" icon and select "Retrieve Pre-step Data".

3. Choose the response body as the extraction source.

4. Use a JSONPath expression (e.g., data.id) to extract the pet ID.

5. Click "Insert" to reference this value in the downstream request.

Write a JSONPath expression to extract data from pre-step

Step 3: Verify Parameter Passing

Run the automated test scenario and check the Test Report. Verify that the pet ID from the "Add a New Pet" step is correctly used in the "Query Pet Information" step.

Check API auto-testing result at Apidog

If an error occurs, debug the step by checking the JSONPath expression and the dynamic value setup.

Conclusion

Test orchestration is a cornerstone of software development, ensuring robust and reliable applications. By leveraging Apidog's dynamic values, teams can seamlessly manage data dependencies, adapt to real-time data changes, scale effectively, and maintain accuracy across extensive test suites. This automation not only accelerates the testing cycle but also enhances overall software quality, enabling faster releases.

Incorporating dynamic values into your test orchestration process simplifies complex tasks, allowing for more efficient and reliable testing. This innovative approach transforms cumbersome manual operations into automated, error-free procedures, ultimately optimizing your testing workflow and contributing to the continuous improvement of your software products.

Explore more

How to Use Claude Code with GitHub Actions

How to Use Claude Code with GitHub Actions

Discover how to integrate Claude Code with GitHub Actions to automate code reviews, fix bugs, and implement features. This tutorial covers setup, workflows, and advanced tips for developers.

29 May 2025

How to Use Google Jules: A Beginners' Guide

How to Use Google Jules: A Beginners' Guide

Master Google Jules with this beginner’s guide. Learn to set up, assign tasks, and review changes with the AI coding assistant to boost your development efficiency.

27 May 2025

How to Use Google AI Studio (for Free)

How to Use Google AI Studio (for Free)

Discover how to use Google AI Studio for free with this detailed guide. Learn to access Gemini 2.5 Flash, optimize usage, and integrate APIs with tools like Apidog. Start experimenting with Google AI Studio today!

26 May 2025

Practice API Design-first in Apidog

Discover an easier way to build and use APIs