Skip to main content

Creating a While Loop

While Sequentum Desktop does not include a While Loop command, there is sufficient branching logic that will allow you to creating something comparable.

Given that the structure and nature of a while loop and for loop are very similar, we will use a For loop as the basis for our While loop. The Sequentum equivalent of a for loop is the For Loop is the Data List Command with "Number Range" as the Data Provider. Set the End Number to something high you think will not be reached before your while condition is no longer satisficed.

Add whatever commands you would like to execute each loop as children of the Data List Command. Your first command however should be an Exit Command (either "Exit or Retry" or "Exit if Data Exists" depending on your while condition). You'll have to set the condition to the opposite of what the while loop would be. For example, if you want to loop while some value is less than 20, you exit if that value is greater than or equal to 20. You'll need to change the Exit Command target from "Agent" to "Parent Command".

It may look something like this:

I am staying on the page while the "New Notification" is present.

I'm going to keep reloading the page until the Notification is no longer present.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.