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.
Asked
Active
Viewed 1,010 times
7

Adam Wagner
- 15,469
- 7
- 52
- 66

Taras
- 488
- 6
- 21
2 Answers
1
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.

kamal_prd
- 543
- 4
- 16
0
Tabhosts and robotium do not mix very well, basically the solo.waitforactivity only expects one activity to be open at a time but with tab hosts bad things happen where multiple activities are actually open and it gets confused.

Paul Harris
- 5,769
- 1
- 25
- 41