Postman Collection Runner
What is the Collection Runner?
The Collection Runner executes every request within a Collection (or a chosen folder) sequentially, without needing to click "Send" on each one individually.
Key Features
- Running requests with different sets of data using a CSV or JSON data file (data-driven testing).
- Choosing the number of iterations and the delay between requests.
- Viewing a pass/fail summary of all assertions written in each request's Tests tab.
Why Testers Use It
The Collection Runner turns a set of individual manual requests into a lightweight, repeatable regression suite that can be run before every release.
Running a Data-Driven Login Test Step by Step
Imagine you want to check a login API with several username and password pairs, some valid and some invalid. Instead of creating one request per pair, write one request and feed it a data file.
- Create a CSV file where the first row holds column names. Each later row becomes one iteration.
- Use the column names as variables in the request, for example in the JSON body.
- Write assertions that compare the response with the expected result stored in the same row.
- Open the Runner from the collection's Run option, select the data file, preview the rows, and choose the iteration count and delay.
- Start the run and review each iteration's request, response and test result.
username,password,expected_status
alice@test.com,Correct#123,200
alice@test.com,wrongpass,401
,Correct#123,400
The request body uses the columns directly:
{
"email": "{{username}}",
"password": "{{password}}"
}
And the test script reads the expected value for the current row with pm.iterationData:
const expected = Number(pm.iterationData.get("expected_status"));
pm.test(`Status is ${expected}`, () => {
pm.response.to.have.status(expected);
});
Controlling the Order of Requests
By default the Runner executes requests in the order they appear in the collection. You can change the flow from a script. For example, after a failed login there is no point calling the profile endpoint, so skip straight to cleanup:
if (pm.response.code !== 200) {
pm.execution.setNextRequest("Cleanup");
}
Passing null stops the run after the current request. Older collections use postman.setNextRequest(), which behaves the same way. Use this sparingly; complicated jumps make suites hard to read.
Taking Runs into CI with Newman
The Runner is great on your desktop, but regression suites should also run automatically. Export the collection and environment, then run them with Newman, Postman's command-line runner:
npm install -g newman
newman run orders.postman_collection.json \
-e qa.postman_environment.json \
-d login-data.csv \
-r cli,junit --reporter-junit-export results.xml
The JUnit report can be picked up by Jenkins, GitHub Actions or Azure Pipelines to show pass and fail counts on every build. The Postman CLI is another official option if your team works inside Postman's cloud workspace.
Mistakes That Make Runs Unreliable
- Requests that depend on data created by a previous run, so the suite passes only once. Create and clean up test data within the run.
- Forgetting to select the right environment before starting.
- Assertions only on status codes; also check key fields in the response body.
- Large files with mixed purposes; keep one data file per scenario so failures are easy to trace.
Ready to master real-world software testing?
Learn manual and automation testing hands-on with mentor-led sessions.