Skip to content

Make Selenium Easy

And Keep It That Way

  • Home
  • Share
  • Toggle search form

Postman Tutorial Part 23 – Introduction to Postman Sandbox

Posted on 03/16/2025 By admin

We know that we can write Pre-request scripts and Tests scripts for a request, collection and folder in a collection to add dynamic behaviour to it. All these scripts run in an environment which is called Postman Sandbox.

The Postman Sandbox is a JavaScript execution environment based on NodeJS that is available to you while writing pre-request and test scripts for requests both in Postman and Newman. Do not worry about newman now. We will see that in upcoming posts. Whatever code you write in these sections is executed in this sandbox.  

Postman Sandbox has many built in JavaScript libraries which we can use while writing scripts. It makes Postman a very powerful tool to write automated scripts for API. Below is just a list of built in libraries in Postman Sandbox:-

Postman sandbox also consists of some NodeJs modules:-

You need to use require() function to use the sandbox built-in library modules. But to use it properly you need to have basic ideas of JavaScript and NodeJS. You can find usage of built in libraries and references here.

Postman’s PM API (pm.*) or pm object is replacing “postman.*”. By using “pm.*” , We can do more with scripting, like easily access request and response elements, assert a set of pre-defined rules for testing to enable better and cleaner tests, and manage environments and variables. You can find all methods available in pm apo here.

When we write tests under “Tests” tab we see a test code like below:-

pm.test("Status code is 200", function () {
    pm.response.to.have.status(200);
});

Now you can understand that “pm” is a global object in Postman which has a method called “test” which has below syntax:

pm.test(testName:String, specFunction:Function):Function

This function is used to write test specifications inside the sandbox. Writing tests inside this function allows one to name the test accurately as well as ensure that in case of any errors inside this function, the rest of the script is not blocked.

We will see some basics functions of pm in upcoming posts.

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: Accessibility Testing in Slides
Next Post: xpath

Related Posts

June 25, 2019 – Make Selenium Easy Uncategorized
selenium 4 features Uncategorized
August 26, 2018 – Make Selenium Easy Uncategorized
February 27, 2017 – Make Selenium Easy Uncategorized
GIT Tutorials – End To End Archives – Page 3 of 3 – Make Selenium Easy Uncategorized
Git Tutorial 8 – Git Push – Upload Committed Local Repository Changes To Remote Repository Branch 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