#1 India's Top IT Training Institute
×

About Uncodemy

Know more about who we are and what we stand for.

About Us

About Us

Discover our mission to equip individuals with essential IT skills and industry expertise.

Read More →
UnCodeMy Gallery

UnCodeMy Gallery

Explore highlights from our IT training sessions and success stories.

Read More →
Mentors

Mentors

Meet the industry experts who train and guide you through your course.

Read More →
Free Resources

Free Resources

Free tutorials, interview questions, tools and calculators to help you learn.

Explore →
×

Free Resources

Learn, practice and plan your career — bilkul free.

Tutorials

Tutorials

Step-by-step written tutorials to learn any technology at your own pace.

Read More →
Free Counselling

Free Counselling

Book a free video counselling session and pick the right course for you.

Read More →
Online Compiler

Online Compiler

Write, run and test your code online — no setup required.

Read More →

Running Collections with Postman Runner

What Is the Collection Runner?

The Collection Runner executes every request in a collection (or folder) in sequence, without manually clicking Send on each one. It's ideal for regression checks and end-to-end flows.

Starting a Run

Open the Runner from the collection's context menu, choose the environment, set the number of iterations and delay between requests, and click Run to execute the whole collection automatically.

Reading the Results

ResultMeaning
PassAll test assertions in that request succeeded
FailOne or more assertions did not match
SkippedRequest was disabled or skipped in the flow

Why It Matters

Running collections repeatedly makes it easy to catch regressions whenever an API changes, without repeating manual testing steps.

Running a collection once is useful, but Postman becomes even more powerful when each run uses different data - that's where data-driven testing comes in.

Writing Tests That the Runner Can Check

The Runner only reports pass or fail for requests that contain tests. Tests are small JavaScript snippets placed in a request's post-response script (labelled "Tests" in older Postman versions). They run after the response arrives.

pm.test("Status is 201 Created", function () {
    pm.response.to.have.status(201);
});

pm.test("Response contains a numeric id", function () {
    const body = pm.response.json();
    pm.expect(body.id).to.be.a("number");
    pm.collectionVariables.set("userId", body.id);   // save for later requests
});

pm.test("Responds in under 800 ms", function () {
    pm.expect(pm.response.responseTime).to.be.below(800);
});

Each pm.test becomes one line in the Runner results. Give tests descriptive names, because a report full of entries called "test 1" tells you nothing when something breaks.

Chaining Requests into an End-to-End Flow

The Runner shines when requests pass data to each other. A typical user-management flow looks like this:

  1. Login stores the returned token with pm.collectionVariables.set("token", ...).
  2. Create user sends Authorization: Bearer {{token}} and saves the new userId.
  3. Get user calls /users/{{userId}} and checks the fields match what was created.
  4. Update user changes a field and verifies the response.
  5. Delete user removes the record so the next run starts clean.

By default the Runner follows the order of requests in the collection. You can change the order inside a script with pm.execution.setNextRequest("Request name"), or stop the run with pm.execution.setNextRequest(null). Older collections use postman.setNextRequest() for the same purpose. Use this sparingly, since jumping around makes flows harder to follow.

Running Collections Outside the App

To include API checks in a CI pipeline, export the collection and environment and run them with Newman, Postman's command-line runner:

npm install -g newman

newman run users.postman_collection.json \
  -e staging.postman_environment.json \
  -n 2 \
  --delay-request 300 \
  -r cli,junit

Here -e selects the environment, -n sets the number of iterations, --delay-request adds a pause between requests in milliseconds and -r chooses reporters. The JUnit report can be read by Jenkins, GitHub Actions and most other CI tools. Postman also offers its own Postman CLI, which can run collections stored in your workspace.

Mistakes that cause confusing results

  • Wrong environment selected. A run against staging that uses production variables can change real data. Check the environment dropdown before every run.
  • Hidden order dependence. A request that works alone may fail in the Runner because an earlier request changed or deleted data. Make each flow set up its own data.
  • Leftover variables. Values saved during one run remain for the next. Clear or reset them in the first request when needed.
  • Sending requests too quickly. APIs with rate limits may return errors that look like failures. A short delay between requests often fixes this.

Ready to master Postman API Testing Course?

Join Uncodemy's hands-on training and build real-world API testing skills with expert mentors.

Explore Course