Handle location Alert:- Allow/Block in Android

Hi All,

In My test scenario, I am executing in lambda test provided android device with robot framework, there is a location alert. I need to click on Allow.
I have used the lambda test capabilites in test setup itself. But alert is still visible and need to be clicked.
Could anyone please suggest how to click on location alert Allow using appium library of robot framework in mobile web platform at android device.

Appium Robot Framework RobotFramework-Dev

Maybe there is a way to pass Appium device Capabilities to allow location data, before the test run. This way the Alert should not show.

@HelioGuilherme66 i have already done that by using capabilities.setCapability options in appium. I have used as shown in screenshot

No, I don’t see any “location” named parameter.
Try to define a known location for your device (actual geo coordinates).

I am adding geolocation=true and assigned an actual latitude and longitude. But still that alert is being shown.

OK
Then you need to inspect the dialog elements in a local execution of the app (without the bypass capabilities). When the dialog appears, it is not from your app, but from the Android/iOS system.
You can then blindly tap on Allow button (after some time).
(I don’t use remote Appium services, only local, so this would be my approach)

Another thing you should consider, is the fact that your capabilities being ignored, because the remote service had already created the device instance. See if you can control those pre-test setups.

Good luck.

1 Like