0
0
Postmantesting~10 mins

Response time assertions in Postman - Test Execution Trace

Choose your learning style9 modes available
Test Overview

This test sends a request to an API endpoint and verifies that the response time is less than 500 milliseconds. It ensures the API responds quickly enough for good user experience.

Test Code - Postman
Postman
pm.test("Response time is less than 500ms", function () {
    pm.expect(pm.response.responseTime).to.be.below(500);
});
Execution Trace - 3 Steps
StepActionSystem StateAssertionResult
1Test starts and sends HTTP request to the API endpointPostman sends request and waits for response-PASS
2Postman receives response from APIResponse received with status code and response time recorded-PASS
3Test script checks if response time is below 500 milliseconds using pm.expectResponse time value available in pm.response.responseTimepm.expect(pm.response.responseTime).to.be.below(500);PASS
Failure Scenario
Failing Condition: Response time is 500 milliseconds or more
Execution Trace Quiz - 3 Questions
Test your understanding
What does the test verify about the API response?
AResponse body contains specific data
BResponse status code is 200
CResponse time is less than 500 milliseconds
DResponse headers include Content-Type
Key Result
Always include response time assertions to ensure your API meets performance expectations and provides a good user experience.