robert
robert

Reputation: 2027

Postman/Newman, how to chain requests based on previous requests responses?

I see multiple tutorials about Postman/Newman test scripts, however they mostly looks like single requests.

What is the best way to chain Postman test request based on previous results, so eg:

Newman seems to run an entire collection independently. I only want to run request 1, which then fires request 2 and request 3 based on output of previous request in that same collection.

Upvotes: 2

Views: 1129

Answers (1)

AntonMaijer
AntonMaijer

Reputation: 21

You can configure this in the Tests section in Postman by using

if (condition) {
    postman.setNextRequest("NAME OF YOUR REQUEST")
}

Upvotes: 2

Related Questions