简体   繁体   中英

How to Handle Allow Location access alert of Firefox using selenium?

In Firefox i have set the location access to allow. but while automating the below popup is still shown. how to solve this? I have used firefox options also.It's not working. scenario: I have to select a city from the dropdown. Browser is showing alert Allow location access to this site with two options . 1.Allow location, 2. Disallow

i have to click on "Allow location"

You can disable the notification popup as given below.

System.setProperty("webdriver.gecko.driver","./Resource/geckodriver.exe");
FirefoxProfile ffprofile = new FirefoxProfile();
ffprofile.setPreference("dom.webnotifications.enabled", false);
WebDriver driver = new FirefoxDriver(ffprofile);
driver.get("https://jabong.com");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM