0
0
Postmantesting~10 mins

First API 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 - 3 Steps
StepActionSystem StateAssertionResult
1Send GET request to https://jsonplaceholder.typicode.com/posts/1Postman sends HTTP GET request to the API endpoint-PASS
2Receive response from the APIResponse received with status code 200 and JSON body-PASS
3Run test script to check status codeTest script executed in Postman test tabVerify response status code equals 200PASS
Failure Scenario
Failing Condition: API returns a status code other than 200
Execution Trace Quiz - 3 Questions
Test your understanding
What does the test verify in this API request?
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 1 second
Key Result
Always verify the API response status code to confirm the request succeeded before checking response data.