Test Overview
This test sends a GET request to a sample API endpoint and verifies the response status code is 200. It checks that the API is working and returning data correctly.
This test sends a GET request to a sample API endpoint and verifies the response status code is 200. It checks that the API is working and returning data correctly.
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 GET request prepared | - | PASS |
| 2 | Send GET request to https://jsonplaceholder.typicode.com/posts/1 | Request sent, waiting for response | - | PASS |
| 3 | Receive response with status code 200 and JSON body | Response received with data for post id 1 | Check response status code is 200 | PASS |
| 4 | Run test script to verify status code | Test script executed in Postman test tab | pm.response.to.have.status(200) | PASS |
| 5 | Test completes successfully | Test result shows PASS in Postman | - | PASS |