How to catch the completion of a progress dialogue Android

Mobile Testing, Android App Testing.
User avatar
Posts: 28
Joined: Wed Jul 08, 2015 7:50 am

How to catch the completion of a progress dialogue Android

Post by sandamal » Tue Sep 01, 2015 3:09 pm

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:
Screenshot_2015-08-25-19-16-05.png (6.65 KiB) Viewed 1341 times

Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

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

Post by krstcs » Tue Sep 01, 2015 3:18 pm

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.
Shortcuts usually aren't...

User avatar
Ranorex Guru
Ranorex Guru
Posts: 6523
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

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

Post by odklizec » Tue Sep 01, 2015 3:27 pm


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...
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.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration