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

2

7

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.

Cubature answered 20/10, 2011 at 14:6 Comment(0)
M
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.

Murmurous answered 7/11, 2012 at 8:27 Comment(0)
G
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.

Grapefruit answered 20/10, 2011 at 14:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.