Do...Loop statement

Relevant for: GUI actions, scripted GUI components, and function libraries

The Do...Loop statement instructs UFT to perform a statement or series of statements while a condition is true or until a condition becomes true. It has the following syntax:

Do [{while} {until} condition]
	statement
Loop

Item

Description

condition

A condition to be fulfilled.

statement

A statement or series of statements to be performed during the loop.

Example: In the following example, UFT calculates the factorial value of the number of passengers using the Do...Loop:

passengers = Browser("Mercury Tours").Page("Find Flights").WebEdit("numPassengers").GetROProperty("value")
total = 1
i = 1
Dowhile i <= passengers
     total = total * i
     i = i + 1
Loop
MsgBox "!" & passengers & "=" & total