How to accept "Allow app to access location" on Android?


I’ve tried to locate “Allow” button on pop up window on Android to allow app to access location, but I’m having problem with it.
All I can access from this pop up is id “” with text “Allow Matchbook to access this device’s location?”

I’ve also tried “self.driver.find_element_by_link_text(“Allow”)”, “self.driver.switch_to_alert()”, “self.driver.switch_to.alert()”
but nothing of these work.

I’m using:
Appium 1.2.6
Python 2.7
Galaxy Nexus emulator
Android OS 6.0
Appium webdriver (from appium import webdriver)

Is there any way to locate this element?


Hi can you try these two variations:


alert = self.driver.switch_to_alert()


el = self.driver.find_element('Allow Matchbook to access this device’s location?')

@Venkatesh_Akula thanks, I’ve tried that also, but it didn’t work.

But finally I got it working, I’ve found answer on stackoverflow:

In my python code it looks like this:


@mate_xanadu try advanced interactions

let us know if it helped