Skip to content

Make Selenium Easy

And Keep It That Way

  • Home
  • Share
  • Toggle search form

Postman Tutorial Part 12 – Understand Environment & Variables in Postman

Posted on 02/19/2025 By admin

A variable is a container which holds information that could be changed. If you have basic programming knowledge, you must have used variables in your programs.

Suppose you are developing a banking application. There are some values which will be used throughout the application or some values unique to a functionality. If you hardcode those values everywhere, just imagine if you need to change value. So we should use variables here. Define it as per need i.e. locally or globally and use its referenced name rather than actual value. If you are required to update value of a variable, just update the value where you have declared. Everywhere updated value will be used.

The same way variables works in Postman. We have many usage of variables in Postman. Below are some usages:

  1. In my previous posts, you would have seen that we are hardcoded domain name in each URI.

https://gorest.co.in/public-api/users/
https://gorest.co.in/public-api/users/123/

This domain name may change or can be different for each environment like QA, Dev , Staging etc. Here variables make our job easier. We can store domain name as per environment in a variable and can call that variable here.

2. We can use variables at several places to make it parameterized such as
URI, URI parameters, headers, authorization, request body, and header presets.

3. Variables can be used to chain request. Extracting data from response , storing and using it for another request as input are possible by using variables.

4. Variables can also be used in pre and post scripts. We can log variables as well.

Let me try to relate it an example. We create configuration files for different environment. It helps us to call required configuration file whenever needed. If we use .properties file, it stores values as key value pairs. Just call the key, it will give you required value. Similar type of things could be achieved in Postman using Environment.

An Environment in Postman is a set of key-value pairs. The key represents the name of the variable and value is information that key holds.

We can create, share, duplicate, export, and delete an environment. You can download it as json and pass it to run collection through newman.

Variables defined in an Environment are Local variables. It means you can use variables of an environment in another environment. So we have another type of variables called Global variables.

Global variables are also a set of key value pair which does not belong to specific environment. It is available in all scopes. You can not select multiple environments at the same time. In that case Global variables save you.

We will see Environments and Global variables in details in upcoming posts. Stay tuned.

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

Uncategorized

Post navigation

Previous Post: How To Locate Web Element Which Has Multiple Class Names
Next Post: Selenium Code Practice – Get All Product Names Of Google Home Page

Related Posts

Is Page Object Model a selenium framework? Uncategorized
October 29, 2017 – Make Selenium Easy Uncategorized
Frequently Asked Java Program 29: Java Program to Remove Duplicate Characters From Word Without Using Collection Concept Uncategorized
Jquerty1 – Make Selenium Easy Uncategorized
December 18, 2018 – Make Selenium Easy Uncategorized
Java Program 13: Java Program To Find If Given Numbers Are Coprime 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