Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The postman.setNextRequest() method can be used to control the flow to a test other than the next test in the list .  See (see this blog on Postman Conditional Workflows and even better  for more). But even better, it can be used to stop a collection run saving the user the pain of looking at a series of tests fail because an earlier test in the run failed.

For example, assume a data domain is created at the start of a test run and is required for the following tests in a Postman collection run, this code block in the request's test script will stop the run if the domain is not created:

...