Test Overview
This test creates a simple API request flow in Postman and verifies the response status code is 200 OK.
This test creates a simple API request flow in Postman and verifies the response status code is 200 OK.
pm.test('Status code is 200', function () { pm.response.to.have.status(200); });
| Step | Action | System State | Assertion | Result |
|---|---|---|---|---|
| 1 | Test starts in Postman | Postman app is open with the API request ready | — | PASS |
| 2 | Send API request to the server | Postman sends HTTP request to the specified endpoint | — | PASS |
| 3 | Receive response from server | Postman receives HTTP response with status code and body | — | PASS |
| 4 | Run test script to check status code | Postman executes test script in Tests tab | Verify response status code equals 200 | PASS |
pm.environment.set('token', pm.response.json().access_token);token after this runs if the response JSON is {"access_token": "abc123"}?pm.request.headers.add({key: 'Authorization', value: 'Bearer ' + pm.environment.get('token')});Pass the test and this pattern moves unknown