RobotiumTech / robotium

Android UI Testing
http://www.robotium.org
Apache License 2.0
2.86k stars 786 forks source link

Robotium can't handle location service dialog #780

Closed bio007 closed 9 years ago

bio007 commented 9 years ago

Hi, I have a problem with Robotium and location dialog from google play services. I would like to test a scenario when user has gps disabled. But when this dialog shows, Robotium can't detect it or even click on screen while it is shown - throwing java.lang.SecurityException: Injecting to another application requires INJECT_EVENTS permission (adding this permission to manifest does not help).

Is there a way around this? Thanks.

screenshot_20150922-090147

renas commented 9 years ago

Thanks for reporting this. Robotium uses the Android instrumentation framework and due to that its only allowed to interact with the app under test. The location dialog does not belong to your app and therefor the Android platform won't let you interact with it.