0

I am facing an issue with an auto prompt for geolocation on safari using selenium. I am not sure if I can do a selenium-click to disappear the prompt. does anyone know how can I disappear the prompt?

I tried several java code, I read some pages but look this issue was never result.

Rafa
  • 23
  • 6
  • Can you provide a link to that prompt? Might be useful to see what is going on – Nic Laforge May 30 '19 at 05:37
  • Can you try the solution in here: https://stackoverflow.com/questions/8411816/how-do-i-enable-geolocation-support-in-chromedriver. Basically you can set your location after you start the driver and it should not prompt you with the pop-up – Nic Laforge May 30 '19 at 05:50
  • that could work on safari, let me check. Thanks! – Rafa May 30 '19 at 05:56
  • Oh forgot.. to mention that I just tried it on safari, not with your site but with another one and it worked – Nic Laforge May 30 '19 at 05:58
  • should be something like this: String script = "window.navigator.geolocation.getCurrentPosition = function(success){ var position = {'coords' : {'latitude': '555','longitude': '999'}};success(position);}"; chromeDriver.executeScript(script); – Rafa May 31 '19 at 04:37
  • @NicLaforge did not work I changed " to ' or \' but not result – Rafa May 31 '19 at 05:23

1 Answers1

0

I have to set up on the preference on safari never ask the location only on that way the pop up on safari never appear.

Rafa
  • 23
  • 6