Testim Documentation

Welcome to the Testim documentation. You'll find comprehensive guides to help you get started quickly, example code snippets, and tips for being more productive. You will also find details about advanced features that allow you to customize Testim to fit your environment or special testing conditions. Don't worry, we'll support you if you get stuck. Let's jump right in!

Guides    Changelog


Repeat a group of steps using: while... do... loops & for loops

The loops will execute group of steps until a condition returns false.
You will define a condition, in a similar way to how you define it in other steps, as described here.


Create a group with the steps you want to repeat/loop.
Read here about creating groups.

How to add the loop condition

  • Click on the group step you created.
  • Open the property panel.
  • Define a condition on "Repeat Group" section. You can define an element or a custom condition. Read here to learn more.

Note: The loop will continue as long as the condition returns true.

Click here to run a demo test of this example.


In some cases, you may want to retry again before declaring a true/false condition and entering a loop. e.g. long page loading time might require wait time before checking the condition.

Retry when condition fails:
Defines a time for retries when the condition is false until the loop stops.
By default, if the condition returns false on first try, the loop will immediately stop.
If you want the system to try again before exiting the loop, use this option.

Minimum pass duration when condition pass:
As a default, if the condition is true the loop will continue into the group. In some cases you might want to retry again before declaring a condition true and entering the loop.
Note: If the condition returns false on the first attempt, it will not retry again even if this option was marked.

How to change those times:

Run Result

After running your test, you can go through each iteration and look at each of the results separately.

You can reach a specific result directly from the group's properties, or you can go over the different iterations from inside the group.
If one of the iterations failed, when entering the group, you will be taken directly to the failed iteration.

Note: The maximum iteration limit is 99 iterations.

For loop

In order to run the same set of actions\validations a number of times, use the "loop for" option. The value of how many times the loop will run can be either a number or a parameter with a number value.
Click here to run a demo test.

For each loop

In order to run the same set of actions\validations on similar elements, use the "for each" option.

Create a group
Click "Repeat Group"
Click "For each"
Choose the first repeating element (for example, the first row of a table)
The group will run in a loop on all elements which are similar to the element chosen in step 4. This is useful to test a list of repeating elements like a table with multiple rows.

Click here to run a demo test.

Loop iterator

It is very often necessary to keep track of the current iteration you’re in while using a loop, for example when iterating through an array. For that purpose, you can use TESTIM_ITERATOR variable in for/while/custom loops.

Click here to run a demo test using TESTIM_ITERATOR

Updated 3 months ago


Repeat a group of steps using: while... do... loops & for loops

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.