Skip to content

Make Selenium Easy

And Keep It That Way

  • Home
  • Share
  • Toggle search form

Postman Tutorial Part 40 – Collection Variables in Postman

Posted on 02/19/2025 By admin

We have already seen what are Global and Environment variables in Postman and its usage in creating parameterized requests. In this post, we will see another type of variables called Collection variables.

Let’s consider some scenarios first:-

  1. If you have followed my posts in sequence, you must have seen that when we import a Collection , it does not include environment and global variables. We explicitly need to download variables file as JSON and share.
  2. If you have multiple collections in workspace, you may confuse with required environment variable file to select.
  3. You may expose critical data which belongs to other collections to wrong recipient while sharing variable files.
  4. You have some data which is not unique to particular environment or say constant value.

All above problems can be solved to a great extent if we use Collection variables. A collection variable only belong to single collection for which it has been created. So when you share a collection, all required variables will also be exported with collection.

You can add variables in Variables tab while creating collection or edit collection to add variables. To edit a collection, Click ellipsis (…) next to the collection name, and select “Edit” to open the EDIT COLLECTION modal.

This variables can be used in same manner as we use normal environment and global variables.

I have added a variable named “BookingID” as collection variable.

I am using above created variable in script as :-

You can see variable usage is same as we do environment and global variables. Scope is changed to Collection.

When you share this collection to anyone, they will get all collection variables as well. This feature helps you to keep variables segregated as per collection.

You can import above example collection from below link:-

https://www.getpostman.com/collections/64c6a38fe95a577ce033

But Collection variable has some major demerits which restricts you to use this variable specifically. Demerits are:-

  1. Collection variables are read only. You can not set its value through scripts.
  2. We can not create Collection variable through scripts.
  3. We can not update value of Collection variable as it is ready only.

#ThanksForReading

Learn Selenium with Quiz

Be master in Selenium-WebDriver

API Testing – Basics

API Testing – Postman

API Testing – Rest Assured

Learn Protractor Step by Step

Frequently Asked Java Programs in Interview

Uncategorized

Post navigation

Previous Post: #2. OAuth 2.0 Flow – Authorization Grants And Their Types
Next Post: stream api in selenium

Related Posts

image – Make Selenium Easy Uncategorized
invalidClassName – Make Selenium Easy Uncategorized
TestNG Tutorials 21: Why Don’t We Require a Main Method In TestNG class For Execution Of Methods? Uncategorized
Frequently Asked Java Programs: 32 – Swap Two String Variables Without Using Third Variable Uncategorized
How To Locate Web Element Which Has Multiple Class Names Uncategorized
Part 1: Handling Drop-down Created Using SELECT Tag In Selenium Uncategorized

Recent Posts

  • Getting Started with Selenium 4: What Is New and How to Upgrade from Selenium 3
  • Manual Testing
  • Baby Steps To Become Efficient Selenium-Java Automation Tester
  • Features of Selenium 4.0.0 Release – Java Binding
  • Part 1: Handling Drop-down Created Using SELECT Tag In Selenium

Recent Comments

No comments to show.

Archives

  • April 2026
  • April 2025
  • March 2025
  • February 2025
  • January 2025
  • December 2024
  • November 2024
  • October 2024
  • September 2024
  • August 2024
  • April 2024
  • March 2024
  • February 2024
  • December 2023
  • October 2023
  • August 2023
  • November 2022
  • September 2022
  • August 2022
  • July 2022
  • May 2022
  • March 2022
  • October 2021
  • April 2021
  • March 2021
  • January 2021
  • December 2020
  • October 2020
  • September 2020
  • August 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • February 2020
  • January 2020
  • December 2019
  • November 2019
  • October 2019
  • September 2019
  • August 2019
  • May 2019
  • December 2018
  • November 2018
  • October 2018
  • September 2018
  • August 2018
  • July 2018
  • January 2018

Categories

  • Getting Started
  • Uncategorized

Copyright © 2026 Make Selenium Easy.

Powered by PressBook Masonry Dark