How to use Break Activity in While or Do While

Hi Team,

I am automating google home page. Wheras my internet connection is very slow. So it took more time to load the page. I am using Element Exists activity to check whether the webpage is loaded completely. If it fails I am retrying it for three times using Do While loop. I want to stop the Do while loop once the Element Exists activity returns true value. I can’t use break activity here.

Solution would be greatfull for many slow loading website.

Thanks in advance

Hi there @BaskaranChidambaram,
While I see what you are trying to achieve, it would be easier to simply increase the TimeoutMS on the Element Exists activity.

As such, the process will wait up to the associated time, but upon finding the necessary Element, will immediately continue.

With that said, you can incorporate a Do While via the below:

Assign - intCounter = 0
Assign - intMax = 10

* Element Exists - IE Loaded - Output = boolIELoaded
* Assign - intCounter = intCounter + 1

While boolIEExists = False AND intCounter < intMax

If boolIELoaded = False Then
Throw New System.Exception("IE Failed To Load After 10 Iterating Checks")
End If

This should loop 10 times, checking whether IE loaded.

Thanks in advance,