Lesson 9: Adding a loop

You will add a loop to the test so that the test is repeated to fetch all of the values from the data pool. Because your datapool has three entries, the test must run at least three times.

About this task

Context for the current task

Procedure

To add a loop:

  1. In the Compound Test editor, select both the test scripts and click Insert > Loop.
  2. To confirm adding a loop, click Yes.
  3. In the Compound Test editor, click Loop and in Loop name, type ProductLoop.
  4. In the Duration area, ensure Count-based is selected and for iterations type 3.
  5. To save the changes, click File > Save. The compound test is now under the loop.Adding loop
  6. To run the test, click Run Compound Test. The compound test is run three times and takes the values from a row for each run.

Results

You have added the compound test in a loop that will run for three times. Each run will fetch one row from the data pool.

Feedback