Loops are used to repeat a scenario a specified number of times.
Example: RunScenario My Scenario -Repeat 60
Description: Repeat My Scenario 60 times.
Example:
Like posts about Test Automation on Twitter
Save the below steps as a new scenario named 'Like Posts’. This will repeat like action on Twitter.
Scroll 3 -UntilVisible Image {HeartIcon}
Click Image {HeartIcon}
IsVisible Text “Unlike”
To like all posts about a topic on Twitter, our main scenario that will perform the liking action would be as follows.
OpenBrowser Chrome “x.com” -Incognito false
ClickAndWrite Text “Search” “Test Automation”
SendKeys ENTER
Wait Text “People”
RunScenario Like Posts -Repeat 20
After performing 20 likes, if you add steps to continue the scenario, you can add ‘-WhenFails Continue’ option as an example below. If the RunScenario steps fail, the execution will continue.
OpenBrowser Chrome “x.com” -Incognito false
ClickAndWrite Text “Search” “Test Automation”
SendKeys ENTER
Wait Text “People”
RunScenario Like Posts -Repeat 20 -WhenFails continue
Click Text “Home”
IsVisible Text “What is happening”