Reputation: 9304
I am running tests on a location-aware site. I can tell Chrome or IE to always allow geo-locate for that one page, but Firefox always forgets once I close the browser.
Anyone else ever encounter this?
Upvotes: 2
Views: 1174
Reputation: 33162
The Selenium driver for Firefox seems to create a new, anonymous profile with each run by default. Hence your settings won't persist, as they will be discarded together with the profile after a run.
You should:
FirefoxProfile
instance to use .setPreference("geo.prompt.testing", true);
and .setPreference("geo.prompt.testing.allow", true);
.webdriver.firefox.profile
Java System property or use the public FirefoxProfile(File profileDir)
constructor to use that existing profile.Upvotes: 4