Recall & Review
beginner
What are Collection variables in Postman?
Collection variables are values stored at the collection level in Postman. They can be used across all requests within that collection to keep data consistent and reusable.
Click to reveal answer
intermediate
How do Collection variables differ from Environment variables in Postman?
Collection variables are specific to a collection and only available within it, while Environment variables are specific to an environment and can be used across multiple collections.
Click to reveal answer
beginner
How can you set a Collection variable in Postman?
You can set a Collection variable by opening the collection, going to the Variables tab, and adding a new variable name and value. You can also set it programmatically using scripts with pm.collectionVariables.set('variableName', 'value').
Click to reveal answer
intermediate
What happens if a variable name exists in both Collection and Environment variables?
Postman uses variable resolution priority. Collection variables override Environment variables if they share the same name when used inside that collection.
Click to reveal answer
beginner
Can Collection variables be used in pre-request scripts and tests?
Yes, Collection variables can be accessed and modified in pre-request scripts and test scripts using pm.collectionVariables.get('variableName') and pm.collectionVariables.set('variableName', 'value').
Click to reveal answer
Where are Collection variables stored in Postman?
✗ Incorrect
Collection variables are stored inside a specific collection and are accessible only within that collection.
Which method sets a Collection variable in a Postman script?
✗ Incorrect
pm.collectionVariables.set() is used to set Collection variables programmatically.
If a variable exists in both Collection and Environment variables, which one is used inside the collection?
✗ Incorrect
Collection variables have higher priority and override Environment variables inside the collection.
Can Collection variables be used in test scripts?
✗ Incorrect
Collection variables can be accessed in test scripts using pm.collectionVariables.get().
How do you add a new Collection variable in the Postman app?
✗ Incorrect
New Collection variables are added in the Variables tab of the specific collection.
Explain what Collection variables are and how they help in managing data in Postman collections.
Think about how you keep common data like API keys or URLs consistent in a group of requests.
You got /4 concepts.
Describe the priority order Postman uses when resolving variables if the same name exists in Collection and Environment variables.
Consider which variable Postman picks first when two variables share the same name.
You got /4 concepts.