4

I'm new in Robotium. When I run my test cases I get the following error: Test run failed: Instrumentation run failed due to 'keyDispatchingTimedOut'.

My TestCase code:

public void testRun_4() {
    // Wait for activity: 'com.youcureme.pharmaguide.activity.MainActivity'
    solo.waitForActivity("MainActivity", 2000);
    // Wait for dialog
    solo.waitForDialogToOpen(5000);
    // Set default small timeout to 58102 milliseconds
    Timeout.setSmallTimeout(58102);

    // Click on Великобритания
    solo.clickOnView(solo.getView("spinner"));
    // Scroll to Россия
    android.widget.ListView listView0 = (android.widget.ListView) solo.getView(android.widget.ListView.class, 0);
    solo.scrollListToLine(listView0, 4);
    // Click on Россия
    solo.clickOnView(solo.getView("tvDropdown", 6));

    // Set default small timeout to 96972 milliseconds
    Timeout.setSmallTimeout(96972);
}
Mate Mrše
  • 7,997
  • 10
  • 40
  • 77
MrAnadole
  • 51
  • 1
  • 5
  • 1
    There's a good chance that your test has uncovered a bug. Your app probably has an OnClickListener whose onClick() takes too long to run. If that's the case then you need do the work in a background thread. One way to do that is with an AsyncTask http://developer.android.com/reference/android/os/AsyncTask.html. – Dave C Apr 22 '14 at 16:09

0 Answers0