0
0
Postmantesting~10 mins

GET request in Postman - Test Execution Trace

Choose your learning style9 modes available
Test Overview

This test sends a GET request to a public 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 - 4 Steps
StepActionSystem StateAssertionResult
1Test startsPostman app is open with the GET request prepared-PASS
2Send GET request to https://jsonplaceholder.typicode.com/posts/1Request sent, waiting for response-PASS
3Receive response from serverResponse received with status code 200 and JSON body-PASS
4Run assertion to check status code is 200Response status code is 200pm.response.to.have.status(200)PASS
Failure Scenario
Failing Condition: The server returns a status code other than 200
Execution Trace Quiz - 3 Questions
Test your understanding
What does the test verify in this GET request?
AThe request method is POST
BThe response status code is 200
CThe response body contains a specific user name
DThe server response time is less than 1 second
Key Result
Always verify the HTTP status code in your API tests to confirm the server responded successfully before checking response data.