0
0
Postmantesting~5 mins

Response time assertions in Postman - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a response time assertion in API testing?
It is a check to make sure the API responds within a set time limit, ensuring the service is fast enough for users.
Click to reveal answer
beginner
How do you write a response time assertion in Postman?
Use pm.expect(pm.response.responseTime).to.be.below(2000); to check the response time is less than 2000 milliseconds.
Click to reveal answer
beginner
Why is it important to assert response time in tests?
Because slow responses can frustrate users and may indicate performance problems that need fixing.
Click to reveal answer
intermediate
What does the following Postman test do? <br>
pm.test('Response time is under 1 second', () => { pm.expect(pm.response.responseTime).to.be.below(1000); });
It checks that the API response time is less than 1000 milliseconds (1 second). If it is slower, the test fails.
Click to reveal answer
intermediate
Can response time assertions help catch backend issues? How?
Yes, if response times suddenly increase, it can signal server overload, slow database queries, or network problems.
Click to reveal answer
In Postman, which code checks if response time is less than 500ms?
Apm.response.responseTime < 500;
Bpm.expect(pm.response.responseTime).to.be.below(500);
Cpm.expect(pm.response.time).to.be.above(500);
Dpm.test('Response time', () => pm.response.time > 500);
Why should response time assertions be part of API tests?
ATo test the API's user interface
BTo verify the API returns correct data
CTo check the API's security settings
DTo ensure the API responds quickly enough for users
What unit is response time measured in Postman assertions?
ASeconds
BMicroseconds
CMilliseconds
DMinutes
If a response time assertion fails, what does it mean?
AThe API took longer than expected to respond
BThe API returned wrong data
CThe API is offline
DThe test script has syntax errors
Which Postman object holds the response time value?
Apm.response.responseTime
Bpm.request.time
Cpm.response.duration
Dpm.test.responseTime
Explain how to write and use a response time assertion in Postman tests.
Think about checking if response time is less than a certain number.
You got /4 concepts.
    Why is monitoring response time important in API testing?
    Consider what happens if an API is too slow.
    You got /4 concepts.