Change Workflow in Postman

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

266 Views

In a Collection, the requests are executed in the sequence in which they are created. However, a workflow can be changed in Postman. To illustrate it, let us take a Collection having four requests.To trigger that Collection, click on the arrow appearing to the right of the name of the Collection in the sidebar. The Run button appears, click on it.The Collection Runner window gets launched. Within the RUN ORDERsection, the sequence in which the requests shall get executed is displayed from the top to bottom. In our example, the order is −GETPOSTPUTDELClick on Run Collection1.A new window appears containing ... Read More

GUID in Postman

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

1K+ Views

GUID means Global Unique Identifier. It is in the form of a hexa-decima digit which is separated by hyphen. It helps to achieve distinctiveness due to this even if multiple people are creating the GUID simultaneously, the chance of having a duplicate GUID is rare.To generate a random value, using GUID, the format is −{    "name": "{{$guid}}" }On sending a request, it would produce a random value.GUID is a value with 128 bits having a structure defined in RFC4122. The structure of GUID is uncomplicated and simple for generation.The format of a GUID is shown below −xxxxxxxx-xxxx-Axxx-Bxxx-xxxxxxxxxxxxHere, A is ... Read More

Postman Cheat Sheet

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

2K+ Views

This Postman Cheat Sheet is based on the official documentation page of Postman (which is available in the below link) and from the overall knowledge on Postman −https://learning.postman.com/docs/getting-started/introduction/a. VariablesAll the variables can be set up manually from the GUI of Postman and they have a defined scope. The values of the variables can also be set with the help of scripts written under the Pre-request Script or Tests tab.The variables can be added in the request URL, Headers and Body in the format as {{}}.Usage in request URL −https://{{domain}}about/{{id}} Usage in request Headers(key-value): X-{{key}}:valueUsage in request Body −{"registration_id": "{{Id}}", "firstname": ... Read More

Use Global Variable in Postman Request

Debomita Bhattacharjee
Updated on 25-Jun-2021 16:24:44

5K+ Views

We can use a Global variable in Postman Request. . We can set, get and clear a Global variable at runtime using the scripts. This is achieved by the pm.* function. The script to use a Global variable can be included either in the Tests or Pre-Request Script tabTo set a Global variable, the script should be −pm.globals.set('', '')To get the value of a Global variable, the script should be −pm.globals.get('')To get the value of the Global variable in the Postman console, the script should be −console.log(pm.globals.get('')To delete a Global variable, the script is −pm.globals.unset('')Let us try to work with ... Read More

Collection Runner in Postman

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

1K+ Views

A Collection Runner in Postman is used for triggering more than one request simultaneously. After execution, the Collection does not yield a Response Body of individual request.The console of Collection Runner generates the pass or fail status of every request. For a Collection Runner, it is compulsory to have at least two requests for the Collection.To trigger a Collection with a Collection Runner follow the below steps −Step1 − Click on the Runner menu in Postman.Step2 − The Collection Runner window shall open up.Step3 − Choose the name of the Collection from Choose a collection or folder.Step4 − Select an ... Read More

Add Cookies in Postman

Debomita Bhattacharjee
Updated on 25-Jun-2021 16:23:49

6K+ Views

We can add cookies in Postman. To add a cookie, the below steps need to be followed −Step1 − Navigate to the Params tab below the address bar and then click on Cookies.Step2 − The MANAGE COOKIES window shall open. It lists down all the current cookies. To add a cookie, click on the Add Cookie button. An edit box with pre-populated values of the cookie are displayed. We can update the value and Save it.Step3 − Send the request to the server.Step4 − After the request has been successfully completed, the Cookies tab in the Response will show the ... Read More

Global Scope Variables in Postman

Debomita Bhattacharjee
Updated on 25-Jun-2021 16:23:29

620 Views

The Global variables are the ones which can be used in every Environments and can be utilized for executing every request. Click on the eye icon available to the top right corner of the Postman application. In the below image, the Global variable g with value value1 is populated under the Globals section.Let us select another Environment – Environment_Test from the No Environment dropdown. Then again click on the eye icon. The Global variable g with value value1 should also be available for this Environment.Now, enter {{g}} in the address bar (with the Environment pointing to Environment_Test) and hover mouse ... Read More

What Are Snippets in Postman

Debomita Bhattacharjee
Updated on 25-Jun-2021 16:23:11

3K+ Views

Snippets are small scripts used in Postman which are used to verify an API. These are pre-developed scripts that can be utilized directly. Thus it helps to save a good amount of time.Snippets can be used in the Pre-request Script and Tests tabs in Postman. Navigate to the Tests tab and the SNIPPETS section should be available to the extreme right of the screen. Click on any snippet to use it in a script.On clicking the link Get a variable, the below script gets populated in the Tests tab which can be used in our own script −pm.variables.get("variable_key");Navigate to the ... Read More

See Request Logs in Postman Console

Debomita Bhattacharjee
Updated on 25-Jun-2021 16:22:50

9K+ Views

We can see request logs in the Postman console. Once a request has been sent, the Postman console records the header of request, variables, Response header and body, certificates, proxy settings, errors, scripts, output obtained from console.log, and so on.The Console is obtained from the Postman application by following the navigation − View menu Show Postman Console. Or using the shortcut Ctrl+Alt+C.Let us send a GET request for an endpoint. Add a Pre-request and Tests scripts.Pre-Request Scriptconsole.log("Tutorialspoint - Postman")Testsconsole.warn("Warning message in console") console.log("Logging message in console") console.info("Info message in console") console.error("Error message in console")Postman Console Output shows the message from ... Read More

Use Environment Variables in Postman

Debomita Bhattacharjee
Updated on 25-Jun-2021 16:21:58

2K+ Views

We can use Environment Variables in Postman. We can configure, obtain and delete an Environment variable at runtime with the help of scripts. This is achieved by the pm.* function. The scripts to use an Environment variable can be included either in the Tests or Pre-Request Script tab.To set an Environment variable, the script should be −pm.environment.set('', '')To get an Environment variable value, the script should be −pm.environment.get('')To get the value of the Environment variable in the Postman console, the script should be −console.log(pm.environment.get(''))To delete an Environment variable, the script should be −pm.environment.unset('')Let us try to use an Environment variable ... Read More

Advertisements