Pankaj Devrani
Pankaj Devrani

Reputation: 511

Postman : How to run some request multiple times and others single time using Postman or Newman

I have three API requests in a postman collection. I want to run the first and third requests once and the second request multiple times using a data file.

When I pass the data file to the Postman runner it runs all the three requests multiple times based on entries in the data file.

Is there a way to tell Postman or Newman to use data files for certain request only and not all of them. Or if there is any workaround or a different approach.

Note:- I am refraining from using separate collections for the requests which I will run multiple times as it would become difficult to maintain multiple collections.

Upvotes: 2

Views: 1538

Answers (1)

Christian Baumann
Christian Baumann

Reputation: 3434

I think this can be achieved with postman.setNextRequest().

Checkout Building request workflows for the details.

Upvotes: 1

Related Questions