0
0
Postmantesting~20 mins

Response time in Postman - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Response Time Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
1:30remaining
What is the response time unit in Postman test scripts?
In Postman test scripts, the response time is accessed using pm.response.responseTime. What unit is this value measured in?
Postman
console.log(pm.response.responseTime);
ANanoseconds
BMilliseconds
CMicroseconds
DSeconds
Attempts:
2 left
💡 Hint
Think about how fast computers measure time and what is practical for API response times.
assertion
intermediate
2:00remaining
Which assertion correctly checks if response time is under 500ms?
You want to write a Postman test to verify the API response time is less than 500 milliseconds. Which assertion is correct?
Apm.test('Response time is less than 500ms', () => { pm.expect(pm.response.responseTime).to.be.below(500); });
Bpm.test('Response time is less than 500ms', () => { pm.expect(pm.response.responseTime).to.be.above(500); });
Cpm.test('Response time is less than 500ms', () => { pm.expect(pm.response.responseTime).to.equal(500); });
Dpm.test('Response time is less than 500ms', () => { pm.expect(pm.response.responseTime).to.be.at.least(500); });
Attempts:
2 left
💡 Hint
Look for the assertion that checks the value is smaller than 500.
🧠 Conceptual
advanced
1:30remaining
Why is monitoring response time important in API testing?
Choose the best reason why response time monitoring is critical in API testing.
ATo verify the API meets performance expectations and user experience standards
BTo ensure the API returns correct data formats
CTo check if the API endpoints are documented properly
DTo confirm the API uses secure authentication methods
Attempts:
2 left
💡 Hint
Think about how slow responses affect users.
🔧 Debug
advanced
2:00remaining
Identify the error in this Postman test for response time
This Postman test is intended to fail if response time exceeds 1000ms. What is wrong with it?
Postman
pm.test('Response time is acceptable', () => {
  pm.expect(pm.response.responseTime > 1000).to.be.false;
});
Apm.response.responseTime is undefined in Postman tests
BThe comparison operator should be >= instead of >
CThe expression inside pm.expect is a boolean, but pm.expect expects a value to chain assertions on
DThe test should use pm.response.time instead of pm.response.responseTime
Attempts:
2 left
💡 Hint
Check what pm.expect expects as input.
framework
expert
3:00remaining
How to integrate response time checks in a Postman Collection Runner with multiple requests?
You want to fail the entire Postman Collection run if any request takes longer than 800ms. Which approach is best?
AUse the Collection Runner settings to set a global timeout of 800ms for all requests
BManually check response times after the run and rerun failed requests
CWrite a pre-request script to abort the request if the previous response time was over 800ms
DAdd a test in each request to check response time and set a collection variable if it exceeds 800ms; then add a final test in a separate request to fail if that variable is set
Attempts:
2 left
💡 Hint
Think about how to track failures across multiple requests in Postman.