Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Robotium: How do I wait for loading to complete before proceeding?

I want to write a Robotium/Junit test for an android app. At certain steps, I want my test to wait until the spinning loading symbol disappears off the screen.

How can I do that?

like image 824
user952342 Avatar asked Feb 23 '12 12:02

user952342


1 Answers

There are different ways in which you can do that. In Robotium there are a lot of different waitFor methods that you can use. In your case you can use:

solo.waitForDialogToClose() //waits for the dialog to close
solo.waitForActivity() // if there is a activity change
solo.waitForText() //if a certain text appears after the loading is done
solo.waitForView() //if a certain view is shown after the load screen is done.

Please see the Robotium API Documentation for more waitFor methods in Robotium.

like image 103
Renas Avatar answered Nov 15 '22 08:11

Renas