Skip to main content

Create a New Test Scenario

In this section, you will learn how to create a new test scenario and import APIs into it.

Test scenarios are used to run multiple APIs together in an orderly manner to test a complete business process.

After opening Apidog, click "Testing" in the left menu bar, click the + button in the upper left corner, select the directory to which it belongs and set the priority to complete the creation.

Add a Testing Step

After you create a test scenario, you can add test steps to it. You can add multiple APIs in a test step, and you can also set additional operations such as test conditions in the step.

After entering the test scenario, click "Add Step" and add an API.

Import from the APIs

Automatically generate a use case based on the API parameters, whose parameter values are empty and need to be filled in manually. Otherwise, the API parameter is empty during operation.

There are two modes: Copy and Bind. The API use case is imported as a "copy", and the parameters in the API use case will also be copied together, which is independent from the original use case data, while not affecting each other after being changed. Importing the API use case in the binding form will directly reference the original use case, and the changes on both sides will be synchronized with each other in real time.

FAQ

How to Make Request Parameters of API B Dependent on the Data Returned by API A?

Use Post-scripts and Variables (normal, environment, or global).

The use case of the A API is written Post-scripts to write the data returned by the API request Variables , for example:

// Retrieve the request response data in JSON format.
var jsonData = pm.response.json();

// Write the value of jsonData.token into a variable.
pm.variables.set("token", jsonData.token);