Telerik blogs

Telerik's WebUI Test Studio Q3 2010 release is almost here!

In our previous blog post, we discussed how to create an If...Else statement with the upcoming Q3 release. Today, we will show you how to add a 'While...Loop' as well as a standard 'Loop'.

Both 'Loops' can be accessed via the 'Logical' menu on the 'Add' Ribbon of the 'Record' tab, as shown below.

Let's take a closer look at the While... loop first.
When you select the 'While...Loop' option you will notice a new step is added to test explorer with a red dot next to it - this indicates there is more that needs to be done before you have working loop.

When you hover your mouse over the 'WHILE (...)' step, you will notice an icon appear to the right of the step, click this icon to shift into 'Select Mode'.

In 'Select Mode' you will see a new column appear with an icon next to all your tests' 'Verify' steps. Clicking this icon will assign the selected 'Verify' step to the While... loop. So in the example below, the test will loop while TextContent of the 'TrueRandomInteger.....' element does not contain '1' - as soon as the element contains '1', WebUI Test Studio will kick out of the loop and continue with the remainder of the test steps.

After selecting a 'Verify' step your view will be updated as shown below indicating a logical condition has been added.

You can now click and drag existing test step(s) onto the 'WHILE' step as shown below - Once the step(s) have been drag / dropped -they will appear indented below - these are the steps that will be repeated until the conditions of the While loop have been met.

To see these features in action, check out the links below:

In addition to the 'While...Loop', We have also included the ability to loop n number of times - simply select the 'Loop' option from the 'Logical' button on the ribbon bar. Once the step has been added, double click it to expand the options where you can specify how many times to loop, I entered '5' below so any step I drag into the 'Loop' will be repeated (5) times.


To see this in action on Telerik TV, see the link below:


Comments are disabled in preview mode.