stephenwang1011 / robotium

Automatically exported from code.google.com/p/robotium
0 stars 0 forks source link

Not able to recognize text/view in the action bar. #204

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Launch activity with action bar.
2.call (solo.clickOnText/solo.clickOnView)
3.

What is the expected output? What do you see instead?
Expected: Should be able to click any item on the action bar.

Actual: Not able to click on any item in the action bar.

What version of the product are you using? On what operating system?
Icecream and sandwich (Android4.0)

Please provide any additional information below.

Original issue reported on code.google.com by anandpai...@gmail.com on 9 Jan 2012 at 7:43

GoogleCodeExporter commented 9 years ago
Unfortunately, that is not possible. ActionBar menu item views are internal 
android OS classes. 

Original comment by renasr...@gmail.com on 9 Jan 2012 at 8:59

GoogleCodeExporter commented 9 years ago
I used solo.clickOnView(solo.getView(R.id.menu_item)) from Robotium to click on 
action bar items. It definitely works with ABS ActionBar library (4.0.3) so it 
should also even work with the native ActionBar. 

Original comment by dandre.a...@gmail.com on 11 Apr 2012 at 10:59

GoogleCodeExporter commented 9 years ago
It works for all Actionbar buttons except for the Home/Up Actionbar button 
(which is on the left).
Tried to do  solo.clickOnView(solo.getView(android.R.id.home)) but had no 
result. 
Any possibility to click on that button?

Original comment by aterme...@gmail.com on 4 Jul 2012 at 3:35

GoogleCodeExporter commented 9 years ago
Aterme...
I know it's kinda late (almost 2 years since the last post), but here is the 
answer:
solo.clickOnActionBarHomeButton()

Try this one, it should work.

Original comment by ifj.fold...@gmail.com on 2 Jul 2014 at 1:38