Page 1 of 1

How to catch the completion of a progress dialogue Android

Posted: Tue Sep 01, 2015 3:09 pm
by sandamal
Hi ,

I have an Android application which goes through a data sync progress dialogue at some point (which take random time to complete)

Ranorex detects the progress dialogue and its text inside it.

How can I find the completion of the progress dialogue to move in to next step?

I thought of catching the 100% in the progress percentage text but I did not find a logic to achieve that yet.

Any advice is appreciated :mrgreen:

Re: How to catch the completion of a progress dialogue Android

Posted: Tue Sep 01, 2015 3:18 pm
by krstcs
Why are you trying to capture the completion? Is there validation of some kind that you are attempting?

If not, you could just use a WaitForNotExist() on the dialog and know that when it finishes and the dialog disappears this step will pass. Otherwise, if the dialog does not disappear within the timeout period, this step will fail. Just make sure to set the timeout to an acceptable period. For example, if you have a requirement that the dialog take no longer than 2 min to complete, you could set the timeout for 2 min and validate this requirement that way.


But, without knowing why you want to capture the completion it is hard to help.

Re: How to catch the completion of a progress dialogue Android

Posted: Tue Sep 01, 2015 3:27 pm
by odklizec
Hi,

If you are able to detect the percentage text, then all you need to do is to create a new repository item (either manually or by tracking), edit its xpath and add innertext (or whatever attribute containing the percentage) with "100%" text. So let's say the xpath should look like this...
.//text[@innertext='100%']
Now all you need to do is to drag&drop this newly created repository item to recording table and from the appeared popup menu select "WaitFor" action. Finally, set the "Exists" parameter and timeout (whatever suits you best, but be careful not to set it too low!). That's all. From now on, your recording will wait until the percentage text reaches 100% or timeout.