jeudi 1 novembre 2018

Disabling of Firefox Geolocation prompt in Selenium does not work

Trying to disable the Geolocation prompt of Firefox where it asks for the permission to locate the user. I have read many posts in the internet and tried different things but it does not work. Firefox asks me everytime for a permission. I want to automate the test and I do not work to allow it everytime.

My current code:

FirefoxProfile fireFoxProfile = new FirefoxProfile("firefoxProfile");
fireFoxProfile.SetPreference("geo.prompt.testing", true);
fireFoxProfile.SetPreference("geo.prompt.testing.allow", true);
FirefoxOptions firefoxOptions = new FirefoxOptions() {
                Profile = firefoxProfile
            };
fireFoxDriver = new FirefoxDriver(geckoDriverPath, firefoxOptions);

Aucun commentaire:

Enregistrer un commentaire