Consider two requests in Postman: Request A saves a token in environment variable authToken. Request B uses this token in its header. What will be the value of the Authorization header in Request B if Request A's test script is:
pm.environment.set('authToken', 'abc123');and Request B's header is set as Bearer {{authToken}}?
Remember how Postman replaces variables in double curly braces with their stored values.
Postman replaces {{authToken}} with the value stored in the environment variable authToken. Since Request A sets it to 'abc123', Request B's header becomes 'Bearer abc123'.
Request A returns JSON: {"userId": 42}. Request B needs to assert that the userId in its response matches the one saved from Request A. Which Postman test script correctly asserts this?
Check how to get environment variables and parse JSON response in Postman.
Option D correctly gets the JSON response, extracts userId, and compares it to the environment variable userId using pm.environment.get(). Other options either use wrong methods or incorrect values.
Request A test script saves a value with:
pm.environment.set('sessionId', pm.response.json().id);Request B uses {{sessionId}} in the URL. But Request B sends the URL with {{sessionId}} literally, not replaced. What is the most likely cause?
Think about the order of request execution and when variables become available.
If Request B runs before Request A completes and sets the variable, the variable is not yet defined, so Postman leaves the placeholder {{sessionId}} as is. This usually happens if requests are run in parallel or manually out of order.
You want to run a sequence of requests where each request uses data from the previous response. Which Postman feature helps automate this chaining?
Think about automating sequences and passing data between requests.
Collection Runner allows running multiple requests in order, using environment variables and scripts to pass data dynamically between requests. Manual execution or running requests simultaneously does not automate chaining effectively.
You need to chain an authentication token from Request A to Request B, but want to avoid exposing it in logs or sharing it accidentally. What is the best practice?
Consider how Postman handles sensitive data and variable scopes.
Marking environment variables as secret hides their values in the UI and logs. Clearing them after use reduces exposure risk. Global variables are shared widely and less secure. Hardcoding tokens is insecure. Printing tokens in logs risks exposure.