Skip to content

Make Selenium Easy

And Keep It That Way

  • Home
  • Share
  • Toggle search form

Postman Tutorial Part 54 – Chaining Requests or Data Sharing among requests in Postman

Posted on 03/21/2025 By admin

As a part of Postman Tutorial – End to End, in this post, we will learn Data sharing among requests or chaining requests in Postman.

When we create an account on Facebook then we need to use the same email id and password whenever we need to login to Facebook. If we consider “Registering a user on Facebook” as one action and “Login to Facebook” as another action then we need to perform “Registering a user on Facebook” followed by “Login to Facebook”. We need to use data or output of the first event as an input to another event. This is called data sharing and while testing we do it a lot of times.

If we see Restful-Booker API, they provide two APIs – Create Booking and Get Booking. We get a booking id from Create booking API and that we use to get booking details. While automating these APIs in Postman, we need to do a setup so that a booking id generated from Create Booking API can be passed to Get booking API. In simple words sharing of data between requests in Postman.

If you have used TestNG then we run multiple TestNG classes together so that we can share data among tests. In simple words, we just need to keep entities together so that data sharing is possible. In the Postman tool, we can do this using a Collection. A Collection in Postman is a group of requests which can be executed as a whole using a Collection runner.

  1. Create a collection in Postman
  2. Creating shareable data as variables
  3. Use or get variables in any requests in a collection.
  4. Run a Collection as a Collection runner.

I have created a collection below. If you are not sure how to create a Collection in Postman then please refer to this post.

So the funda of sharing data between requests is simple. You need to save shareable data as a variable using scripts in Postman.

I have created and saved Create Booking request as below:-

We get a field “bookingid” in response which we want to use for Get booking API. Let’s extract and save this data as a variable using Tests scripts. You can save it as environment, global, or collection variables.

Create another request in Get Booking API and use variable created in the previous step.

You will be getting an error as “Unresolved variable” for “bookingid” above. Don’t worry about that as this variable is created during runtime and it will have a value.

Run the above collection using a collection runner. Remeber indiviudal run of request will not help in this case. Anyway data shairng can be done without Collection as well. I will cover that in next post.

You can see booking id 15 is passed to another request.

You can import the example collection from here.

You can subscribe to my YouTube channel RetargetCommon to learn from video tutorials.

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: Frequently Asked Java Program 26: Java Program to Find Occurrence of Each Char in a Given String Without Using Collection
Next Post: Test Automation Framework – A Platform To Develop Test Scripts

Related Posts

July 27, 2018 – Make Selenium Easy Uncategorized
July 13, 2018 – Make Selenium Easy Uncategorized
Protractor Tutorial 3 – Prerequisites To Learn Protractor Uncategorized
Hierarchy of Selenium Classes and Interfaces – Make Selenium Easy Uncategorized
How to Verify if Options in Dropdown are Sorted as Expected In Selenium WebDriver – Java Uncategorized
REST Assured Tutorial 33 – De-Serialization – JSON Object To Java Object Using Jackson API 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