</>

Technology

Postman

Difficulty

Intermediate

Interview Question

What is the Collection Runner in Postman and how do you use it?

Answer

Postman Collection Runner

The Collection Runner allows you to run all requests in a collection sequentially, view test results, and optionally use data files for data-driven testing.

How to Open Collection Runner

  1. Click on a Collection in the sidebar
  2. Click the Run button (▶) at the top right
  3. Or: click the ... menu → Run collection

Collection Runner Options

OptionDescription
IterationsHow many times to run the collection (e.g., 3)
DelayWait time between requests (ms)
Data fileCSV or JSON file for data-driven testing
Save responsesStores response data for review after run
Run orderDrag requests to reorder them

Data-Driven Testing with CSV

users.csv:

CSV
username,password,expected_status
admin,admin123,200
user1,password1,200
invalid,wrongpass,401

In your test script:

JavaScript
pm.test("Status matches expected", function () {
    pm.response.to.have.status(parseInt(pm.iterationData.get("expected_status")));
});

In Collection Runner:

  • Set Iterations to 3 (number of CSV rows)
  • Select users.csv as the data file
  • Click Run

Reading Results

The runner shows:

  • ✅ Passed / ❌ Failed for each test in each request
  • Total pass rate
  • Response times per request
  • Export results as HTML report

Running via Newman (CLI)

Bash
# Run collection
newman run my-collection.json

# With environment
newman run my-collection.json -e staging.json

# With data file
newman run my-collection.json -d users.csv

# With HTML report
newman run my-collection.json --reporters html --reporter-html-export report.html

Use Case Example

Run a full login → create user → get user → update → delete flow, verifying each step with test assertions.

Follow AutomateQA

Related Topics