0
0
Postmantesting~20 mins

Chaining request data in Postman - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Postman Chaining Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2:00remaining
What is the output of this Postman test script chaining example?

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}}?

Aabc123
BBearer {{authToken}}
CBearer abc123
DAuthorization header will be empty
Attempts:
2 left
💡 Hint

Remember how Postman replaces variables in double curly braces with their stored values.

assertion
intermediate
2:00remaining
Which assertion correctly verifies the chained response value in Postman?

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?

Apm.test('UserId matches', () => { pm.expect(pm.response.json().userId).to.eql(pm.variables.get('userId')); });
Bpm.test('UserId matches', () => { pm.expect(pm.response.json().userId).to.eql('userId'); });
Cpm.test('UserId matches', () => { pm.expect(pm.response.userId).to.eql(pm.environment.userId); });
Dpm.test('UserId matches', () => { pm.expect(pm.response.json().userId).to.eql(pm.environment.get('userId')); });
Attempts:
2 left
💡 Hint

Check how to get environment variables and parse JSON response in Postman.

🔧 Debug
advanced
2:00remaining
Why does this chained request fail to use the saved variable?

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?

ARequest B runs before Request A finishes, so variable is not set yet.
BThe variable name is misspelled in Request B's URL.
CEnvironment variables are disabled in Postman settings.
DRequest A's test script has a syntax error preventing variable set.
Attempts:
2 left
💡 Hint

Think about the order of request execution and when variables become available.

framework
advanced
2:00remaining
Which Postman feature best supports chaining multiple requests with dynamic data?

You want to run a sequence of requests where each request uses data from the previous response. Which Postman feature helps automate this chaining?

ARunning requests in separate tabs simultaneously
BCollection Runner with environment variables and pre-request scripts
CUsing Postman monitors without variables
DManual execution of requests one by one
Attempts:
2 left
💡 Hint

Think about automating sequences and passing data between requests.

🧠 Conceptual
expert
3:00remaining
What is the best practice to securely chain sensitive data between Postman requests?

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?

AStore the token in a Postman environment variable with <code>secret</code> flag enabled and clear it after use
BSave the token in a global variable for easy access across collections
CHardcode the token in Request B's headers to avoid variable exposure
DPrint the token in console logs for debugging and remove later
Attempts:
2 left
💡 Hint

Consider how Postman handles sensitive data and variable scopes.