Hello Guys,

We have already seen two basic posts about:-

  1. Introduction to Collection
  2. Creating a collection in Postman

In this post, we will see How to run a Collection in Postman.

You can relate a Postman Collection as a test suite for functional, regression or smoke. You may want to run all tests in a suite all together. Like we run a TestNG xml file containing Selenium tests. The same we can achieve in Postman using Collection Runner.

How to Run a Collection?

Import below collection in your postman to understand further examples well.

https://www.getpostman.com/collections/603df4d90a8e6d4de49b

Above collection has four requests:-

  1. Generate access token.
  2. Create a new booking. Assert booking id is not null and setting it as environment variable to use in further APIs.
  3. Get all bookings and assert new booking id is listed.
  4. Get details of new booking id.

Click on “Arrow” or Expand icon at Collection name and click on “Run” button.

You will see a new Window will be opened with title as “Collection Runner”.

There are many fields which we will understand slowly in later posts. As of now, observe two fields:-

  1. Collection name – It should be same as collection name.
  2. Environment – Selected environment in Collection.

Leave the selected value as it is and click on “Run <Collection Name>” button.

You will see all APIs in selected collection are run in the order they appear in Collection and Run Result is generated.

Above Run Results shows:-

  1. All APIs/requests executed.
  2. It shows status, time and response size for each request.
  3. Tests of requests if exists otherwise it will show message as “This request does not have any tests.”
  4. Total number of tests passed and failed.

When you click on any request, it will show Request URL, Request Headers, Response Body and Response Headers:-

You can directly launch Collection Runner by clicking on Runner button at header:-

When we launch collection runner using above option, it will not select any collection by default as we have seen above. It will lists all collections and you need to select desired one.

More about API Testing in upcoming posts. Stay tuned.

If you have any doubt, feel free to comment below.
If you like my posts, please like, comment, share and subscribe.
#ThanksForReading
#HappyApiTesting

Author: Amod Mahajan

My name is Amod Mahajan and I am an IT employee with 6+ years of experience in Software testing and staying in Bengaluru. My area of interest is Automation testing. I started from basics and went through so many selenium tutorials. Thanks to Mukesh Otwani as his tutorials are easy and cover basics to advance. I have habit of exploring concepts by deep diving. I used to make notes. I thought of sharing my knowledge through posts and now I am here. #KeepLearning #ShareLearning

Leave a Reply