Found 75 Articles for REST API

How to get the value of environment variable in Postman?

Debomita Bhattacharjee
Updated on 25-Jun-2021 16:19:09

4K+ Views

We can get the value of an Environment variable in Postman at runtime with the help of scripts. This is done with the help of the pm.* function. The script to get the Environment variable can be included either in the Tests or Pre-Request Script tabTo get an Environment variable, the script should be −pm.environment.get('')Finally, to get the value of the Environment variable in the Postman console, the script should be −console.log(pm.environment.get(''))Let us try to get the value of the Environment variable tutorial.Step1 − Add the below script to get the value of the Environment variable tutorial and print it ... Read More

How to clear the global variables in Postman?

Debomita Bhattacharjee
Updated on 25-Jun-2021 16:17:33

2K+ Views

We can clear the Global variables in Postman at runtime with the help of scripts. This is done with the help of the pm.* function. The script to clear the Global variables can be incorporated either in the Tests or Pre-Request Script tabTo clear the Global variable, the script should be −To clear the Global variable, the script should be −pm.globals.unset('')Let us try to clear the Global variable url.Step1 − Add the below script in the Pre-request Script tab −pm.globals.unset('url')Step2 − Click on Send to execute a request.Step3 − After the Response is received, click on the eye icon to ... Read More

How to create a Global Variable in Postman?

Debomita Bhattacharjee
Updated on 25-Jun-2021 16:16:10

820 Views

We can create a Global variable in Postman. A Global variable can be utilized in all the Environments and can be applied to all requests. In Postman, if we have the same variable name for the Global and Environment variable, then the preference is given to the Environment variable.To create a Global variable follow the steps listed below −Step1 − Click on the eye symbol appearing right of the No Environment dropdown. Then click on Edit in the Globals section.Step2 − The MANAGE ENVIRONMENTS window comes up. Here, we have added the variable url and set the value as https://www.tutorialspoint.com/index.htm. ... Read More

Creating Variables using Pre Request Script using Postman?

Debomita Bhattacharjee
Updated on 25-Jun-2021 16:14:26

4K+ Views

We can create variables using Pre-Request Script in Postman. We can set, update, or clear variables prior to the execution of the actual request. To set an Environment variable, we have to add the below script under the Pre-Request Script tab.postman.setEnvironmentVariable(name of variable, value of variable)To set a Global variable, we have to add the below script under the Pre-Request Script tab.postman.setGlobalVariable(name of variable, value of variable)Step1 − Select an Environment – Environment_Test from the No Environment dropdown.Step2 − In the address bar enter {{URL}} (an Environment variable available to the Environment_Test). Hover over {{URL}} to find the Scope of ... Read More

How to Manage Cookies in Postman?

Debomita Bhattacharjee
Updated on 25-Jun-2021 16:13:13

2K+ Views

We can manage Cookies in Postman. We can add, delete and update a cookie. The cookies are information dispatched by the server and saved in the browser.When a request is sent, the cookies are yielded by the server. The cookies are mentioned under the Headers and Cookies tab in the Response in Postman. To work with Cookies, we have to click on the Cookies link available under the Params tab.On clicking on it, the MANAGE COOKIES appears. It contains all the available cookies along with the options – Add Cookie and Delete.To add a cookie, click on the Add Cookie ... Read More

What are Local Scope Variables in Postman?

Debomita Bhattacharjee
Updated on 25-Jun-2021 16:12:31

752 Views

The local variables in Postman are also known as the Environment variable. The scope of the local variable is confined to the Environment in which it is created.The steps to create a local variable are listed below −Step1 − Click on the New menu, then click on Environment.Step2 − MANAGE ENVIRONMENTS pop-up gets launched. We will enter the Environment name as ENV1. Then we will add a variable u and its value as https://jsonplaceholder.typicode.com/users. Next, close the pop-up.Step3 − The new Environment (ENV1) will be available as one of the items in the No Environment dropdown.Step4 − Select the ENV1 ... Read More

How to Specify the Path to save Newman report on Jenkins using Postman?

Debomita Bhattacharjee
Updated on 25-Jun-2021 16:10:19

565 Views

We can specify the path to save Newman's report on Jenkins. Jenkins reports are available in various formats and can be managed by appending flags in the build commands. Besides, we can mention the path of the directory where the reports shall get saved with the help of these build commands.The steps to specify the path to save Newman reports on Jenkins are listed below −As a pre-condition, Jenkins should be established in the system. The steps to work with Jenkins are available in the link − https://www.tutorialspoint.com/jenkins/index.htm. Moreover, the Newman should be installed in the system and a Collection ... Read More

How to set a global variable in Postman?

Debomita Bhattacharjee
Updated on 25-Jun-2021 16:08:01

9K+ Views

The global variables can be accessed by all the Environments and is available for every request. To set a global variable follow the below steps −Step1 − Click on the eye icon beside the No Environment dropdown and then click on the Edit link within the Globals section.Step2 − MANAGE ENVIRONMENTS pop-up opens up. Here, we have added the variable url and the value as https://www.tutorialspoint.com/index.htm. Click on Save then close the pop-up.Step3 − Now, select a different Environment and see if the Global variable url is accessible. Here, we have two different Environments - Environment_Test and Mock Server.Step4 − ... Read More

How to Create an Environment in Postman?

Debomita Bhattacharjee
Updated on 25-Jun-2021 16:05:30

5K+ Views

We can create an Environment in Postman. An Environment is a group of variables that we can use in a Postman request. By creating Environments for production, testing, staging and so on, we can run the same URL in various Environments.Step1 − Click on the eye icon beside the No Environment dropdown and then click on the Add link within the Environment section.Step2 − MANAGE ENVIRONMENTS pop-up opens up. We will enter the Environment name. Here, we have added the variable u and the value as https://jsonplaceholder.typicode.com/users. Then close the pop-up.Step3 − The new Environment (ENV1) displays as one of ... Read More

What is Postman Console?

Debomita Bhattacharjee
Updated on 25-Jun-2021 16:03:19

593 Views

The Postman Console can be opened from the Postman application View menu Show Postman Console. Or using the shortcut Ctrl+Alt+C.Postman Console WindowInitially the message – No logs yet gets reflected in the Postman Console. There is an option to search for logs in the Console. We can clear all previous logs with the Clear button. Also, we have the option to filter all the levels of the Logs like Error, Log, Info and Warning from the All Logs dropdown.Every network request sent gets logged in the Postman Console. Once a request is sent, we can get the Response Body, code, ... Read More

Advertisements