Perform a basic load test on a REST API endpoint using Postman
Preconditions (3)
✅ Expected Result: All 50 requests complete successfully with status code 200, and the average response time is within acceptable limits (e.g., less than 500 ms)
pm.test('Status code is 200', () => { pm.response.to.have.status(200); }); pm.test('Response time is less than 500ms', () => { pm.expect(pm.response.responseTime).to.be.below(500); });
The test script uses Postman's pm.test function to create two checks for each request.
First, it verifies the HTTP status code is 200, meaning the request was successful.
Second, it checks that the response time is below 500 milliseconds to ensure the API performs well under load.
These scripts run automatically for each request during the Collection Runner execution, allowing us to validate all 50 iterations.
Now add data-driven testing by running the load test with 3 different API endpoints
Pass the test and this pattern moves unknown