Called from Wrong Thread Exception in Robotium Testcase

0
0

I’m writing Testcase using Robotium for my android app which has multiple activities. The app implements Drawer in UI. But when solo opens drawer, it gives the exception Called From Wrong Thread Exception. Drawer loads when ActionBar Home is clicked.

public void test4Drawer()
{
solo1
.clickOnActionBarHomeButton();
Boolean actual=solo1.searchText("About");
Boolean expected =true;
assertEquals
("Drawer Not Loaded",expected,actual);
}
  • You must to post comments
0
0

In you setUp():

mActivity = getActivity();

And in you test case add this:

mActivity.runOnUiThread(new Runnable() {
public void run() {
solo1
.clickOnActionBarHomeButton();
}
});

But the error should not appear when you use standart robotium methods. If this solution does not work for you, please share full stack trace here.

  • You must to post comments
Showing 1 result
Your Answer
Post as a guest by filling out the fields below or if you already have an account.
Name*
E-mail*
Website