Back to All Questions
Question 35 of 100
Intermediate API Testing
Intermediate
Q35: What are Global Variables in Postman? Scoping Dynamics.
🌐Core Concept
What are Global Variables in Postman? Scoping Dynamics.
Key Takeaways & Architecture Summary
- ✓Broadest scope in Postman; available across all collections and environments.
- ✓Useful for quick prototyping, debugging, and static configurations.
- ✓Accessible via {{variable_name}} in request screens.
Direct Answer Summary
Global Variables in Postman are workspace-wide variables accessible across all collections, requests, and environments. While useful for quick prototyping or sharing global constants (e.g., standard timezones), they represent a broad scope that should be used sparingly to prevent naming conflicts.
⚠️ Senior Engineering Warning (Red Flag)
Avoid utilizing global variables as a default variable scope. Since global variables are shared across all workspaces and collections, they can lead to variable naming conflicts and data collision issues.
💡 STAR Architectural Explanation & Pro Tip
Postman resolves variable scopes in a strict hierarchy: Global -> Collection -> Environment -> Local -> Data. More specific variables (like Environment) overwrite broader scopes (like Global) if they share the same name.
RestAssuredTest.java
Rest-Assured + Java// Set and read global variables in Postman
pm.globals.set("systemName", "CareerRaah-Testbed");
const sysName = pm.globals.get("systemName");