Test Overview
This test sends multiple API requests quickly to check if the server blocks requests after a limit is reached. It verifies that the server enforces rate limits by returning the correct status code when too many requests are made.
This test sends multiple API requests quickly to check if the server blocks requests after a limit is reached. It verifies that the server enforces rate limits by returning the correct status code when too many requests are made.
pm.test("Status code is 200 for allowed requests", function () { pm.response.to.have.status(200); }); // Simulate multiple requests in a loop (conceptual, Postman runner handles actual repetition) // After limit, expect 429 Too Many Requests pm.test("Status code is 429 when rate limit exceeded", function () { pm.response.to.have.status(429); });
| Step | Action | System State | Assertion | Result |
|---|---|---|---|---|
| 1 | Test starts and Postman sends the first API request | API server is ready and accepts requests | Check response status code is 200 | PASS |
| 2 | Postman sends multiple API requests rapidly to the server | Server receives requests in quick succession | Check each response status code is 200 until limit reached | PASS |
| 3 | Postman sends one more request after reaching rate limit | Server detects too many requests from client | Check response status code is 429 (Too Many Requests) | PASS |
| 4 | Test ends after verifying rate limit enforcement | Server continues to enforce rate limits | - | PASS |