Test Overview
This test sends a GET request to a sample API endpoint and verifies that the response status code is 200, indicating success.
This test sends a GET request to a sample API endpoint and verifies that the response status code is 200, indicating success.
pm.test("Status code is 200", function () { pm.response.to.have.status(200); });
| Step | Action | System State | Assertion | Result |
|---|---|---|---|---|
| 1 | Send GET request to https://jsonplaceholder.typicode.com/posts/1 | Postman sends the HTTP request to the server | - | PASS |
| 2 | Receive response from server | Response received with status code 200 and JSON body | - | PASS |
| 3 | Run test script to check status code | Test script executes pm.response.to.have.status(200) | Verify response status code equals 200 | PASS |