Jump into concepts and practice - no test required
or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Recall & Review
beginner
What is the iteration count in Postman?
The iteration count is the number of times a Postman collection or request runs during a collection run. It helps test APIs multiple times with different data or scenarios.
Click to reveal answer
beginner
How can you access the current iteration number in Postman scripts?
You can access it using pm.info.iteration. It starts from 0 for the first iteration and increases by 1 each time.
Click to reveal answer
beginner
Why is iteration count useful in API testing?
It allows running the same test multiple times with different data sets, helping to find bugs that appear only in certain cases or after repeated calls.
Click to reveal answer
beginner
How do you set the number of iterations in Postman?
When running a collection in the Collection Runner, you specify the number of iterations in the 'Iterations' input box before starting the run.
Click to reveal answer
beginner
What will pm.info.iteration return on the third run if iterations start at 0?
It will return 2 because iteration counting starts at 0, so the first run is 0, second is 1, and third is 2.
Click to reveal answer
In Postman, what does pm.info.iteration represent?
AThe current iteration number starting from 0
BThe total number of requests in the collection
CThe number of failed tests
DThe current request index
✗ Incorrect
pm.info.iteration gives the current iteration count starting at 0 for the first run.
How do you specify how many times a collection runs in Postman Collection Runner?
ABy modifying the test scripts
BBy editing the request URL
CBy changing environment variables
DBy setting the 'Iterations' number before running
✗ Incorrect
The 'Iterations' input in Collection Runner controls how many times the collection runs.
If you want to run a test 5 times with different data sets, what should you do in Postman?
ARun the collection once only
BManually run the request 5 times
CSet iterations to 5 and use data files
DChange the request method to POST
✗ Incorrect
Setting iterations to 5 and using a data file allows running tests with different data automatically.
What is the starting value of pm.info.iteration in Postman?
A1
B0
C-1
DUndefined
✗ Incorrect
Iteration count starts at 0 for the first run in Postman.
Why might you use iteration count in your test scripts?
ATo run different tests or data based on the iteration number
BTo change the request URL automatically
CTo skip tests randomly
DTo stop the collection run early
✗ Incorrect
You can use iteration count to customize tests or data for each run.
Explain how iteration count works in Postman and how you can use it in your tests.
Think about running the same test multiple times with different inputs.
You got /4 concepts.
Describe a real-life scenario where using iteration count in Postman would help improve API testing.
Imagine testing a login API with many usernames and passwords.
You got /4 concepts.
Practice
(1/5)
1. What does the iterationCount setting in Postman control?
easy
A. The number of requests in a collection
B. The number of times a collection or request runs automatically
C. The number of tests inside a single request
D. The number of environments available
Solution
Step 1: Understand the role of iterationCount
The iterationCount defines how many times Postman runs the entire collection or request automatically.
Step 2: Differentiate from other counts
It is not about the number of requests or tests, but how many times the run repeats.
Final Answer:
The number of times a collection or request runs automatically -> Option B
Quick Check:
iterationCount = run times [OK]
Hint: iterationCount means how many times to run tests [OK]
Common Mistakes:
Confusing iterationCount with number of requests
Thinking iterationCount counts tests inside a request
Mixing iterationCount with environment count
2. Which of the following is the correct way to set iteration count to 5 in Postman Collection Runner?
easy
A. Set iterationCount = 5 in the pre-request script
B. Set environment variable iterationCount to 5
C. Add pm.iterationCount = 5 in the test script
D. Enter 5 in the 'Iterations' field of the Collection Runner UI
Solution
Step 1: Identify how to set iteration count in Postman UI
The Collection Runner has an 'Iterations' input field where you specify how many times to run.
Step 2: Understand script limitations
Setting iterationCount in scripts or environment variables does not control the runner's iteration count.
Final Answer:
Enter 5 in the 'Iterations' field of the Collection Runner UI -> Option D
Quick Check:
Use Collection Runner UI to set iterations [OK]
Hint: Set iterations number in Collection Runner UI field [OK]
Common Mistakes:
Trying to set iterationCount in scripts
Confusing environment variables with runner settings
Assuming iterationCount is a pm API property
3. Consider this test script in Postman run with iterationCount = 3: