Turn your manual testers into automation experts! Request a DemoStart testRigor Free

Working with loops in testRigor

Loops are a step or a sequence of steps that will be repeated continually until a certain condition is met.

Loops are useful for several different scenarios. For instance, it’s commonly necessary to scroll through very long pages until a certain text is visible or a certain button is visible.

In testRigor, we trigger a loop with the keyword until.

An example of this would look like the following:
scroll down until page contains "Submit" until page contains stored value "previously generated id"
Another common example is when we need to navigate through a list or table that may span multiple pages. If we wanted to find the name “Tom” from a long list of 10 pages, assuming we button to go to the next page on the list is called Next, we could use the following:
click "Next" until page contains "Tom"
click "Tom"
By default, the action will be executed up to 10 times, but you can extend the number of times by adding up to and the maximum number of times the action should be repeated:
click "Next" up to 12 times until page contains "Tom"

Loops with Reusable Rules

Reusable rules can also be used in loops. You may need to group certain actions to be used in a loop, or there may be certain actions that are not currently supported in a loop. By putting that sequence of actions or the unsupported action into a rule, we can force it to loop.

An example of a command that is not currently supported in a loop is go back. However, if you use it as a single line in a reusable rule and name the rule something different from the step itself (for instance go back rule), loops will work.

Incorrect example:
go back until page contains "Welcome to homepage!"
Correct example (given the rule is created):
go back rule until page contains "Welcome to homepage!"

IMPORTANT NOTE: The maximum amounts of time testRigor can execute a loop is 42.

Reference link: For more info about Loops in testRigor, go here.

Related Articles

All-Inclusive Guide to Test Case Creation in testRigor

Test cases fuel test automation tools. Over the years, the process of automating these test cases has undergone many changes. ...

How to Create Tests Using Live Mode in testRigor?

testRigor offers a unique capability known as the ‘Live Mode‘ to create and validate test cases. Using it, you can ...

CI/CD Series: testRigor and Azure DevOps

TestRigor manages different types of CI/CD tools in order to enhance with AI your workflows and pipelines. This time, we’ll ...
On our website, we utilize cookies to ensure that your browsing experience is tailored to your preferences and needs. By clicking "Accept," you agree to the use of all cookies. Learn more.
Cookie settings
Privacy Overview
This site utilizes cookies to enhance your browsing experience. Among these, essential cookies are stored on your browser as they are necessary for ...
Read more
Strictly Necessary CookiesAlways Enabled
Essential cookies are crucial for the proper functioning and security of the website.
Non-NecessaryEnabled
Cookies that are not essential for the website's functionality but are employed to gather additional data. You can choose to opt out by using this toggle switch. These cookies gather data for analytics and performance tracking purposes.