Skip to content

Make Selenium Easy

And Keep It That Way

  • Home
  • Share
  • Toggle search form

Postman Tutorial Part 48 – All Types of Variables in Postman

Posted on 03/21/2025 By admin

We have already learnt about all types of variables in Postman in Postman Series on my blog. This post will bring all concepts of variables together so that you can learn or revise your concepts at one place.

A variable is a named memory space which is used to store and manipulate values. You can read more about variables here.

There are five types (Infact six) of variables available in Postman:-

  1. Environment Variable
  2. Global Variable
  3. Collection Variable
  4. Data Variable
  5. Local or Logging or Temporary or Debugging variable

There is one more variable called “Dynamic Variable” which is predefined. I kept it separately from above categorization as it is related to generate random data or value for other variable. For example :- Getting current timestamp as value for a field. You can not change it every time before running. So dynamic variable makes your life easier. You just need to use predefined variable {{$timestamp}} . It will always use current timestamp as a value. You can read more about Dynamic variables here.

As the name says “Environment” , you can configure variables as per different environments like testing, development , UAT or etc environment to use in API. Just select the environment you want and variables value will be used based on selected environment. Read more about environment variables here.

“Global” terms defines its purpose. A variable which is defined outside of any environment is called a global variable. The scope of global variable is within workspace. It is available for each environment in workspace. In fact global variable is independent of environment variables. You can access global variables irrespective of selection of any or no environment. Read more about global variable here.

Collection variables are exclusive to single collection which is created within Collection. This is useful to store constants. I am using word “Constant” here as you can not set or update it through scripts. Read more about it here.

Postman allows you to read data from csv and JSON in request and scripts. Apart from this the major usage of data variable is to achieve data driven testing of an API which means running a script for multiple set of data. Like collection variable you can not update or create data variables through script. You can learn about reading data from csv in Postman here and reading data from a JSON file here. You can also read about Achieving data driven testing using csv in Postman here and Achieving data driven testing using csv in Postman here.

Local variables are something which remains in memory or scope till the execution is happening. We can create local variables only using scripts in Postman. We can use JavaScript way to create a variable (Using var or let) or pm api ( pm.variables.set(,). We can access local variable directly using reference if created using JavaScript way. If local variable is created using pm api reference, we can access them by using pm API reference as pm.variables.get(). Read more about Local variables here.

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

#HappyLearning

Uncategorized

Post navigation

Previous Post: amod
Next Post: CSS Selector In Selenium Webdriver: Points You Must Know

Related Posts

April 13, 2017 – Make Selenium Easy Uncategorized
Java Programs 15: Java Program to Print Fibonacci Series at Given Position Using Recursion | Make Selenium Easy Uncategorized
TestNG Tutorials 68 : Sharing Data Between Tests in a Suite Using ISuite & ITestContext Uncategorized
image – Make Selenium Easy Uncategorized
image – Make Selenium Easy Uncategorized
FindAll Annotation In Page Factory In Selenium WebDriver 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