0

In Android monkeyrunner, is there anything similar to waitForPageToLoad() (like in Selenium), as I don't want to use Thread.sleep() because of its limitations?

Elly Gayle
  • 67
  • 1
  • 6

1 Answers1

0

Try Robotium, which is a test framework for Android apps.

Quote: "Robotium is an Android test framework that has full support for Activities, Dialogs, Toasts, Menus and Context Menus. The project home page is at http://www.robotium.org/"

Robotium provides a set of APIs for waiting for an Activity/View etc. e.g. waitForActivity(String name) and waitForView(Class<T> viewClass)

Yaohui.W
  • 328
  • 3
  • 15
  • Thanks Alex. In our project, I'm supposed to use MonkeyRunner only. I know that Robotium might be better than MonkeyRunner but it still is MonkeyRunner which I have to use and not Robotium. – Elly Gayle Dec 31 '12 at 06:33
  • Sorry, I'm not sure if MonkeyRunner could achieve this... BTW, what are the limitations of `MonkeyRunner.sleep()` you've metioned? Since you are executing a PC side script, you could just let it safely sleep for a pretty long time, thus you can avoid unpleasent things like racing conditions etc.. – Yaohui.W Jan 02 '13 at 10:54