Times - Selenium IDE
Times (number of loops) - Selenium IDE command
The times command is used to create a loop that executes the proceeding commands n number of times. The input is the number of attempts a times control flow loop will execute the commands within its block.
The value of the ${!times} internal variable counts the number of the current loop. This is the same concept as the ${!loop} variable that is used to count the loops triggered by the LOOP button. Times can be used in nested loops (example), too. In this case the ${!times} value is unique for each times level. The value is always the count of the current times...end level.
Break and Continue
If you are working with loops, you might find it useful at some point to either break the loop when a certain condition is met or you might want to skip over one or more iterations of the loop. This is what the break and continue statements are used for.
Times Example
The example macro loops 5 times and prints the current value.
Command | Target | Pattern/Text |
---|---|---|
open | https://ui.vision/ | |
times | 5 | |
echo | This is loop number ${!times} | |
end |
Works in
Ui.Vision RPA for Chrome Selenium IDE, Ui.Vision RPA for Firefox Selenium IDE, Firefox IDE Classic
Related Demo Macros
DemoGotoIf, DemocsvSave
The ready-to-import-and-run source code of all demo macros can be found in the Open-Source RPA software Github repository.
See also
while, forEach, do...repeatIf, gotoIf, gotoLabel, Label, !statusOK, !errorIgnore, Web Automation Extension User Manual, Selenium IDE commands, Selenium IDE Flow Control (SelBlocks),
Anything wrong or missing on this page? Suggestions?
...then please contact us.