I'm trying to set up a Firefox(Windows, 61.0) profile for use in Selenium WebDriver (3.13.0) with Java so that Firefox automatically downloads files so that I can bypass download dialogs.
Here's the code:
FirefoxOptions options = new FirefoxOptions();
FirefoxProfile profile = new FirefoxProfile();
profile.setPreference("browser.download.folderList",2);
profile.setPreference("browser.download.useDownloadDir",true);
profile.setPreference("browser.helperApps.neverAsk.saveToDisk","application/x-download");
return options.setProfile(profile);
browser.download.folderList
and browser.helperApps.neverAsk.saveToDisk
both affect the settings you'd expect them to affect, but in the case of browser.download.useDownloadDir
, it doesn't affect the actual setting (i.e. it remains false). Rather, it creates a new, similar (?) setting called services.sync.prefs.sync.browser.download.useDownloadDir
.
Any idea what the issue is here, and how I can set the useDownloadDir setting to true
?