I'm writing test cases to validate the maps using Selenium webdriver. When I try to open the maps using url then location alert is popped up.
I want to allow the map to access the current location by default when the map is loaded without location alert.
I have tried using profile in the ChromeOptions but it is not satisfying my requirements.
Map<String, Object> prefs = new HashMap<String, Object>();
Map<String, Object> profile = new HashMap<String, Object>();
prefs.put("profile.default_content_setting_values.geolocation", 1); // 1:allow 2:block
options.setExperimentalOption("prefs", prefs);
capabilities.setCapability(ChromeOptions.CAPABILITY, options);
webDriver = new ChromeDriver(capabilities);
Any help would be appreciated.