Running multiple iterations

This topic describes how to run multiple iterations of a Collection. It also describes:

Before you start, download the collection. json file we'll use to explain multiple iterations.

The iterations of a collection run reflect how many times the collection will run. This example shows a collection run with five iterations.

collection runner collection runner results

Switching between iterations

To quickly jump between iterations, you can click one of the numbers on the right sidebar. Each number represents one iteration.

Using green and red filters

The left sidebar contains three filters, which you can use to show all, passed, or failed tests. These filters are useful to help you quickly find bugs in your API.

collection runner filters

Debugging with multiple iterations

Working with multiple iterations can become tedious when switching between them to check for expected behavor. For this reason, there's a third screen in the collection runner, which is the Run Summary screen.

When a run is finished (or stopped), you can open up the Run Summary screen by clicking the orange Run Summary button.

run summary

This screen is, as the name suggests, an overview of your run. Here, you can see each request, and its pass/fail status as a timeline.

A request is treated as Passed if all tests inside it pass. Similarly, if one or more tests fail, the request is marked as Failed.

The numbers in the header represent the current iteration. Now its easy to pinpoint the misbehaving test. Click on an iteration in the header for that iteration, so you can further investigate what might be wrong.

Iterations in the collection runner are 1-indexed with the first iteration beginning with a count of 1.

Note that this is different than the iteration count accessible programmatically in the Postman sandbox, which is 0-indexed with the first iteration beginning with a count of zero.

Programmatically customize iteration data

To provide data for a collection run, the Collection runner provides a "Data file" option. However, if you want to access and manipulate that data in the collection runs, you will need to it programmatically through scripts. This can be done by the pm.iterationData object, which provides several methods to programmatically access and manipulate the data, allowing the access of iteration data during a collection run.

For a list of methods provided by the iterationData object, see: pm.iterationData

For more information about collection runs, see: