0
0
Postmantesting~10 mins

Send request block in Postman - Test Execution Trace

Choose your learning style9 modes available
Test Overview

This test sends a GET request to a sample API endpoint and verifies that the response status code is 200, indicating success.

Test Code - Postman
Postman
pm.test("Status code is 200", function () {
    pm.response.to.have.status(200);
});
Execution Trace - 3 Steps
StepActionSystem StateAssertionResult
1Send GET request to https://jsonplaceholder.typicode.com/posts/1Postman sends the HTTP request to the server-PASS
2Receive response from serverResponse received with status code 200 and JSON body-PASS
3Run test script to check status codeTest script executes pm.response.to.have.status(200)Verify response status code equals 200PASS
Failure Scenario
Failing Condition: Response status code is not 200 (e.g., 404 or 500)
Execution Trace Quiz - 3 Questions
Test your understanding
What does the test script verify in this Postman test?
AThe response status code is 200
BThe response body contains a specific user name
CThe request method is POST
DThe response time is less than 100ms
Key Result
Always verify the response status code to confirm the server handled the request successfully before checking response content.