0
0
Postmantesting~10 mins

Iteration count in Postman - Test Execution Trace

Choose your learning style9 modes available
Test Overview

This test checks that the Postman collection runs the expected number of iterations. It verifies the iteration count matches the configured value.

Test Code - Postman Test Script
Postman
pm.test('Iteration count is correct', function () {
    const expectedIterations = 3;
    const actualIterations = pm.info.iteration;
    pm.expect(actualIterations).to.be.below(expectedIterations);
});
Execution Trace - 5 Steps
StepActionSystem StateAssertionResult
1Test starts in Postman runnerPostman collection runner is open with iteration count set to 3-PASS
2Postman runs first iteration (iteration index 0)Request sent, response receivedCheck pm.info.iteration is 0 and less than 3PASS
3Postman runs second iteration (iteration index 1)Request sent, response receivedCheck pm.info.iteration is 1 and less than 3PASS
4Postman runs third iteration (iteration index 2)Request sent, response receivedCheck pm.info.iteration is 2 and less than 3PASS
5Postman stops running after 3 iterationsCollection run completeTotal iterations run equals configured iteration count 3PASS
Failure Scenario
Failing Condition: The iteration count exceeds the configured value or pm.info.iteration is incorrect
Execution Trace Quiz - 3 Questions
Test your understanding
What does pm.info.iteration represent in the test script?
AThe number of requests sent so far
BThe total number of iterations configured
CThe current iteration index starting from 0
DThe response time of the request
Key Result
Always verify iteration count using pm.info.iteration to ensure your Postman collection runs the expected number of times.