Closed GoogleCodeExporter closed 9 years ago
The actionbar views are not text views and therefore you need to use getView()
and then clickOnView() just as you do. Please update to Robotium 5.3.1 and the
security exceptions will be gone. Let me know if it fixes the problem for you.
Original comment by renasr...@gmail.com
on 3 Mar 2015 at 5:25
Thanks for your fast answer.
I was using the clickOnText on the navigation drawer items, not the action bar.
Yes, I will update then to the last version and check if the security exception
is gone.
To tap on the 'hamburger' icon, should I use:
Solo.clickOnActionBarHomeButton
OR
View view = Solo.getView(android.R.id.home);
Solo.clickOnView(view);
seems the last one for your answer, however, the method
clickOnActionBarHomeButton seems made for that?
Original comment by ban...@gmail.com
on 3 Mar 2015 at 5:35
Always use the ID. ClickOnActionBarHomeButton does not work on the support
library.
Original comment by renasr...@gmail.com
on 3 Mar 2015 at 5:37
Still have the same SecurityException (sometimes):
Failure in testDifferentFragmentsCanBeSelected:
junit.framework.AssertionFailedError: Click at (85.0, 147.0) can not be
completed! (java.lang.SecurityException: Injecting to another application
requires INJECT_EVENTS permission)
at com.robotium.solo.Clicker.clickOnScreen(Clicker.java:106)
at com.robotium.solo.Clicker.clickOnScreen(Clicker.java:205)
at com.robotium.solo.Clicker.clickOnScreen(Clicker.java:170)
at com.robotium.solo.Solo.clickOnView(Solo.java:1096)
This is the code:
final View homeView = solo.getView(android.R.id.home);
solo.clickOnView(homeView);
solo.sleep();
Do you have any idea what could be?
Original comment by ban...@gmail.com
on 3 Mar 2015 at 9:35
Security exceptions are thrown by the Android platform when trying to click on
a View that belongs to another app. Is something blocking the view you are
trying to click?
Original comment by renasr...@gmail.com
on 3 Mar 2015 at 9:37
No. I have the last screenshot and our app is the most front (no dialog).
Already using Robotium 5.3.1
Original comment by ban...@gmail.com
on 3 Mar 2015 at 9:42
This is strange. Would it be possible for you to email me your apk?
Original comment by renasr...@gmail.com
on 3 Mar 2015 at 9:43
Hey,
Sorry for the late response.
Regarding the APK, can't provide the debug version. Or do you want a production
version?
The problem still happens on 5.3.1 :(
The device is a Nexus 5 ART with 4.4.2.
Other devices seems more stable (Huawei Valiant Y301 A1 4.1.1 and Sony Experia
P 4.0.4)
Thanks
Original comment by ban...@gmail.com
on 9 Mar 2015 at 4:42
Original issue reported on code.google.com by
ban...@gmail.com
on 3 Mar 2015 at 5:19