After allowing for "all the site to get your physical location" using chrome setting, still popup getting populated. How to handle geo location popup using java selenium? Can anyone please help me?
Asked
Active
Viewed 407 times
1
-
Have you searched for similar questions already? [question 1](http://stackoverflow.com/questions/34721359/chrome-profile-to-disable-know-your-location-pop-up/34723230#34723230) [question 2](http://stackoverflow.com/questions/28390611/how-can-i-allow-location-access-using-selenium/28390721#28390721) – JDelorean Aug 18 '16 at 11:05
-
Both the way i have tried,but its not working for me. – selen Aug 26 '16 at 09:25
1 Answers
1
To disable this message you need to add chrome options:
options.addArguments("--enable-strict-powerful-feature-restrictions");
options.addArguments("--disable-geolocation");
Full example:
public WebDriver createDriver(){
ChromeOptions options = new ChromeOptions();
options.addArguments("disable-infobars");
options.addArguments("disable-notifications");
options.addArguments("--enable-strict-powerful-feature-restrictions");
options.addArguments("--disable-geolocation");
return new ChromeDriver(options);
}

splekhanov
- 116
- 1
- 2
- 9