Recall & Review
beginner
What is response time benchmarking in API testing?
Response time benchmarking is measuring how long an API takes to respond to a request. It helps check if the API is fast enough for users.
Click to reveal answer
beginner
Why is it important to set a response time threshold in Postman tests?
Setting a threshold helps decide if the API is performing well or slow. If response time is above the threshold, the test fails, showing a performance problem.
Click to reveal answer
intermediate
How can you check response time in Postman test scripts?
Use the built-in variable pm.response.responseTime to get the response time in milliseconds. Then write assertions to compare it with your expected limit.
Click to reveal answer
intermediate
Example of a Postman test to fail if response time is over 500ms?
pm.test('Response time is under 500ms', () => {
pm.expect(pm.response.responseTime).to.be.below(500);
});
Click to reveal answer
intermediate
What factors can affect API response time during benchmarking?
Network speed, server load, request size, and backend processing all affect response time. Testing should consider these to get realistic results.
Click to reveal answer
In Postman, which variable holds the API response time in milliseconds?
✗ Incorrect
pm.response.responseTime is the correct variable to get response time in Postman test scripts.
Why should you benchmark response time in API testing?
✗ Incorrect
Benchmarking response time measures how fast the API responds, which is key for performance.
What happens if a Postman test asserts response time below 300ms but actual time is 400ms?
✗ Incorrect
If actual response time is above the threshold, the assertion fails and so does the test.
Which of these is NOT a factor affecting API response time?
✗ Incorrect
User interface color does not affect API response time.
How can you automate response time checks in Postman?
✗ Incorrect
Writing test scripts with pm.response.responseTime automates response time checks.
Explain how to write a Postman test script to benchmark response time and fail if it exceeds a limit.
Think about how to get response time and check it with pm.expect
You got /3 concepts.
List common factors that can influence API response time during benchmarking.
Consider what happens between sending a request and getting a response
You got /4 concepts.