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.
Robotium. waitForActivity() returns false for embedded activity in TabHostActivity
Asked Answered
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.
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.
© 2022 - 2024 — McMap. All rights reserved.