Test Overview
This test sends a GET request to a sample API endpoint and verifies that the response status code is 200, indicating a successful request.
This test sends a GET request to a sample API endpoint and verifies that the response status code is 200, indicating a successful request.
pm.test("Status code is 200", function () { pm.response.to.have.status(200); });
| Step | Action | System State | Assertion | Result |
|---|---|---|---|---|
| 1 | Test starts | Postman app is open with the test script loaded | - | PASS |
| 2 | Sends GET request to https://jsonplaceholder.typicode.com/posts/1 | Request sent, waiting for response | - | PASS |
| 3 | Receives response with status code 200 | Response received with status 200 OK and JSON body | - | PASS |
| 4 | Runs assertion pm.response.to.have.status(200) | Response status code is 200 | Check if response status code equals 200 | PASS |
| 5 | Test ends with PASS | Test result shows status code assertion passed | - | PASS |