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?
✗ Incorrect
Option B correctly uses Postman's assertion syntax to check response time is below 500 milliseconds.
Why should response time assertions be part of API tests?
✗ Incorrect
Response time assertions focus on speed, ensuring the API is fast enough for good user experience.
What unit is response time measured in Postman assertions?
✗ Incorrect
Postman measures response time in milliseconds.
If a response time assertion fails, what does it mean?
✗ Incorrect
A failed response time assertion means the API was slower than the limit set in the test.
Which Postman object holds the response time value?
✗ Incorrect
The response time is accessed via pm.response.responseTime in Postman.
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.