Force next iteration on Test script


I have a collection with 3 requests: one to get an authorization token, another with a GET and the last with a POST.

I only want to run the first one when the token expires and the last one based on the result from the GET, but for that I have to iterate through the data file without going through all the 3 requests. Is there a way I can do that on the test script, so I can get the next data from the file before the iteration actually ends?

Not sure how you check if the auth token is expired in your system, but I would do a pre-request script.

For the GET you can do a test script, and based on the result use postman.setNextRequest to decide wether or not to run the final POST request


// Check output of GET request
if (output > 0){
    postman.setNextRequest("POST request name");
} else {