SDET Unicorns

Variables in Postman

Postman Variables

Table of Content

In this post, we will go over Postman Variables and look into different types of variable scope that are available in Postman and how we can use them with Postman Collection.

What are Postman Variables?

Variables are like boxes where you can store data and reuse them when needed. For example, you can store data related to your requests like your baseURL or API key or maybe some test data that you are using for your requests like username and password. You can store all these values in Variable and give it a name that you can reuse throughout Postman.

Postman Variables Scope

Postman has different scopes that allow or block the usage of a variable in a particular context. For example, if you have 2 collections and you don’t want other collections to use your variable you can give it a Collection scope to add Collection level scope restriction on it.

  • Global variables – available throughout the workspace and can be accessed between environments, collections, requests, and test scripts.
  • Collection variables – available throughout the requests in a collection
  • Environment variables – set of variables stored for each environment, for example, local development vs testing or production.
  • Local variables – temporary variable, only available for a single request or collection run and are no longer available when the run is complete.
  • Data variables – import variables from external files (CSV & JSON), can be used when running collections via Newman or the Collection Runner.

Check out the video below to learn more about Postman Variables –


To learn about API Test Automation using JavaScript, check out my free tutorial series here –

JavaScript API Test Automation Tutorial Series


I hope this post helped you out, let me know if you have any questions in the comments below!

Happy testing! 

My Resources

Thrive Suite: The all-in-one WordPress theme I used to create my blog.
Jasper AI: My favorite AI writing tool.
Surfer SEO:  A tool to help you rank your content on the first page of Google.

Write Content Faster

5/5

Write blog posts that rank for affiliate terms!

Join our mailing list

Unlock the Secrets to Becoming a SDET Pro in the Industry!

Stay ahead of the curve! Join our mailing list for exclusive insights, tips, and the latest industry updates delivered straight to your inbox

Table of Content

Related Post

Functional vs Regression Testing

Functional Testing vs Regression Testing: Main Differences

Testing has increasingly become a requirement in the software development lifecycle in recent years. The realization that development is no longer a focal point for stakeholders but saving costs by catching defects early in their application makes it necessary to learn different testing types.

Read More »