Hi Guys,
In the last tutorial, We have already learned how to set up the workspace. Now, In this tutorial “Use Postman like a PRO – Setup Environment“, We will move one step ahead and learn the most important topic Environment
Variables
Like any other programming language, Postman variables also work the same way. They are used to store values and then can be utilized among environments, collections, request, and scripts.
Variables are key-values pairs, Each name of the variable represents its keys. And referencing the name of the variable allows you to access its value.
There are two ways to create an environment in postman,
1. By clicking on the NEW button (Top Left Corner)
2. By clicking on the eye icon near No Environment (Top Right corner)
First Way

Second Way

Now you can see the popup and then click on the Add button to create a new environment.
After that, it will open another window at the center of the screen.

Here I have created two variables that will be present within my environment. The scope of URL and env variable will be limited to the “Development” Environment only. That means I cannot use these two variables in any other environment.
So let’s try to access our variables. Now you don’t have to enter your address each time for every request. You can simply write the below line to access your variable. To access the variables you have to put it inside two curly braces.
{{URL}}/api/v1/auth/login

You can clearly see in the screenshot that we are not entering the URL manually instead we are using the URL variable that we have just created in our dev environment. With the help of variables in postman, you can make your testing super easy, isn’t it?
Also if you haven’t checked my previous tutorials then you can check them out too.