API scenario testing
Number of APIs: 3
๐๏ธ Get started here
Qodex's [scripting] feature allows you to build conditional workflows using a collection. You can branch and loop over a set of requests.
This template contains a sample conditional workflow for testing successful user creation across a data array.
The workflow is set to run in successive iterations with different values in each iteration. If the API returns a successful response in an iteration, the next iteration is triggered, and so on. You will get a report of successful user creations when all the iterations are successful. If a user creation fails, the loop is terminated, and you will get a report of the failed attempt.
The [Qodex.setNextRequest()] function enables you to change the order of requests in a collection while testing. This function allows you to conditionally skip specific requests, repeat requests, terminate the collection early, etc. You can use conditional workflows in various use cases, from [generating a Spotify playlist] to [checking your website for broken links]
๐ How to use this template
Step 1: Open the collection and click on the View more actions
icon.
Step 2: Click Run Collection
to open the [collection runner]
Step 3: Click on Run Conditional Workflow
to run the collection.
Modifying the data
You can find the data array in the collection variables section, which you can navigate to by clicking on the collection's name in the sidebar and then selecting the Variables tab.
The data array follows this structure:
[
{
"username": "",
"name": "",
"role": ""
},
...
]
๐กRelated templates
Async operations
Data visualization
Integration testing
Reusing requests and scripts
Run collection with data file
-
Create users based on an array of data POST http://postman-echo.com/post
-
Report successful user creation POST {{successAPIUrl}}
-
Report failed user creation POST {{failureAPIUrl}}