How can i click on tabs in my app. i mean how can i click on object without an ID?Thanks--
You received this message because you are subscribed to the Google Groups "Robotium Developers" group.
To view this discussion on the web visit https://groups.google.com/d/msg/robotium-developers/-/CvgCunzRf4wJ.
To post to this group, send email to robotium-...@googlegroups.com.
To unsubscribe from this group, send email to robotium-develo...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/robotium-developers?hl=en.
I answered this the other day on stackoverflow, go to here to see the answer: http://stackoverflow.com/questions/13207068/androidrobotium-tab-click-with-only-icon/13231410#13231410or here it is slighly less readable:Tabhosts are evil. Luckily i also have had to automate them and so know the answer.
what you do is you have to get the tab bar view (android.R.id.tabs) and then cast it to a Tabhost or a ViewGroup then you can get each of the tabs via .getChildAt(x) where x is the index of the tabs.
ViewGroup tabs = (ViewGroup) solo.getView(android.R.id.tabs); View viewYouWantToDoStuffWith = tabs.getChildAt(x); //change x to the index you want.In your case you would then want something like:
solo.clickOnView(viewYouWantToDoStuffWith);
Yahor
To unsubscribe from this group, send email to robotium-developers+unsub...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/robotium-developers?hl=en.
--
You received this message because you are subscribed to the Google Groups "Robotium Developers" group.
To post to this group, send email to robotium-...@googlegroups.com.
To unsubscribe from this group, send email to robotium-developers+unsub...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Robotium Developers" group.
To post to this group, send email to robotium-...@googlegroups.com.
To unsubscribe from this group, send email to robotium-developers+unsub...@googlegroups.com.