Run specific testcases only once in a iteration

First of all, you have four requests, not four tests.

Each of those post requests could have a single test, multiple tests (or none at all).

Now we’ve got that out of the way.

When you run this with the collection runner and data file, it will run the entire collection for each line in the CSV.

For the work flow you are describing, I can think of two options.

  1. Move the Authorization and No Input requests to a pre-request script using the Postman sendRequest() function. You will need to initialize a variable to determine whether the request has already run or not, and then use conditional logic (an IF statement) to control whether you need to send the request or not.

  2. Keep the requests as they are but use the skip request feature to skip the request if its already been run. (You will again need to initialize a variable to determine whether the request has run or not).

Optimize Your API Testing Workflow with Postman’s Skip Request Feature | Postman Blog

The New Skip Request Feature - :newspaper: Postman News - Postman Community

1 Like