Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Robotium. waitForActivity() returns false for embedded activity in TabHostActivity

I have a TabHostActivity that has 4 tabs (and 4 corresponding Activities). When in the test I click on one of them("Search") the SearchActivity should appear (and it actually does). The problem is that in Robotuim-test I try to wait for this activity using solo.waitForActivity() and it fails even if the Activity is on the screen. Also all view of this activity are not available via solo.getView() - returns nulls.

like image 574
Taras Avatar asked Oct 20 '11 14:10

Taras


1 Answers

If solo.waitForActivity() doesn't work, you can use solo.sleep(time) and followed by solo.assertCurrentActivity("not desired activity", Activity.class) to confirm that you are in desired activity. And you can continue with further action performance.

like image 199
kamal_prd Avatar answered Nov 13 '22 10:11

kamal_prd