Need help with Appium C# automation for handling Web (Chrome) Geo Location pop up

I am facing issue in handling Geo Location pop up in Chrome mobile browser. My framework is C# based.


I tried clicking using id, class name etc. But throwing No element exception error.
Also i tried passing chrome capabilities for autoGrantPermissons, autoAcceptAlerts, AllowGeoLocation etc. but nothing worked.

I am trying to execute using real device.
PFB the details:
Android Version: 6.0.1
Chrome Version: 64.0.3282.137

Appium Version: 1.7.1
Selenium version: 3.0.1

Could any one please help with the same as this is really important for my project.

Thanks in advance.

I am also facing this issue. Can some one please help?

I am also seeing the same issue, I tried all the above options which JoyalJose has already tried, but it either throws NoElementException or Alert not found issue.
Appium Version: Appium v1.7.2
browserName: Chrome
OS version: Oreo 8.0

If any buddy has solution please update on this

Check this SO answer. It’s Python but it should be easy to translate into C#. You need to switch context to NATIVE_APP and then find ‘Allow’ or ‘Block’ button within the popup using following xpath expressions:


and click it.