I been trying to download a file with latests versions of Firefox using the PHP Webdriver for Selenium but I cannot make it work. This is the code I have in my phpunit bootstrap.php
file for the WebDriver configuration for Firefox:
$profile = new FirefoxProfile();
$caps = DesiredCapabilities::firefox();
$profile->setPreference('browser.download.folderList', 2);
$profile->setPreference('browser.download.manager.showWhenStarting', false);
$profile->setPreference('browser.download.dir', __DIR__.'/temp');
$profile->setPreference('browser.helperApps.neverAsk.saveToDisk', 'application/pdf');
$caps->setCapability(FirefoxDriver::PROFILE, $profile);
RemoteWebDriver::create('http://localhost:4444/wd/hub', $caps);
Some of those preferences, like browser.helperApps.neverAsk.saveToDisk
doesn't exist on the about:config
page. I can add them manually, but even doing that, I cannot make Firefox download a file to an specific folder without asking me if I want to save it.
Maybe is not possible anymore?
Thank you!