How to use do while?

uiautomation
uipath

#1

Hi,

I have a table and above the table i have a refresh button. I want to refresh the table data till a row appears in the table. I want to use do while control.How to use for this ??

Also suggest other ways too

Thanks,
Vishal Kumar


#2

Hi there @vishal.kumar,

Assign - boolRowPopulatedExists = False
Assign - IntMaxIterations = 5
Assign - intIterations = 0

Do While boolRowPopulatedExists = False AND intIterations < IntMaxIterations
 
* Element Exists - Selector = 'Table With Populated Row' - TimeoutMS - 30000 - Exists = boolRowPopulated
* intIterations = intIterations + 1

End Do While

If boolRowPopulatedExists = False Then

* Throw AE

End If

The above will check for the populated row five times, each with a timeout of 30 seconds.

Should it find the element, it will stop iterating.

Should it iterate more than five times, it will throw.

Thanks,
Josh