0
0
Postmantesting~10 mins

Why running collections validates flows in Postman - Test Execution Impact

Choose your learning style9 modes available
Test Overview

This test runs a Postman collection to check if the API flows work correctly end-to-end. It verifies that each request gets the expected response and that the sequence of calls behaves as planned.

Test Code - Postman Tests
Postman
pm.test('Status code is 200', function () {
    pm.response.to.have.status(200);
});

pm.test('Response has expected property', function () {
    const jsonData = pm.response.json();
    pm.expect(jsonData).to.have.property('id');
});
Execution Trace - 6 Steps
StepActionSystem StateAssertionResult
1Test runner starts and loads the Postman collectionPostman app is open with the collection loaded-PASS
2Runner sends the first API request in the collectionRequest sent to API server, waiting for response-PASS
3Runner receives response with status 200Response received with JSON bodyCheck if status code is 200PASS
4Runner executes test script to verify response body has 'id' propertyResponse JSON parsedVerify response JSON contains 'id' propertyPASS
5Runner proceeds to next request in the collectionNext request prepared with data from previous response if needed-PASS
6Runner completes all requests and tests in the collectionAll requests executed, all tests passedAll test assertions passed for each requestPASS
Failure Scenario
Failing Condition: API response status is not 200 or expected property missing in response
Execution Trace Quiz - 3 Questions
Test your understanding
What does the test check after receiving the API response?
AThat the status code is 200
BThat the response time is less than 1 second
CThat the server is running on port 8080
DThat the request method is POST
Key Result
Running a collection validates flows by checking each API response and its data step-by-step, ensuring the entire sequence works as expected.