Robotium waitForActivity () returns false for inline activity in TabHostActivity

I have a TabHostActivity that has 4 tabs (and 4 corresponding actions). When in the test I click one of them("Search") , SearchActivity should appear (and it really is). The problem is that in Robotuim-test I try to wait for this action with solo.waitForActivity() , and it does not work even if Activity is displayed on the screen. Also, all representations of this action are not available through solo.getView() - returns null values.

+7
source share
2 answers

If solo.waitForActivity() not working, you can use solo.sleep(time) and then solo.assertCurrentActivity("not desired activity", Activity.class) to confirm that you are in the desired activity. And you can continue to carry out further actions.

+1
source

Tabhosts and robotium don't mix very well, basically solo.waitforactivity only expects one activity to be open at a time, but bad things happen to the host tabs when several actions are actually open, and this is confusing.

0
source

All Articles