from this answer
FirefoxProfile firefoxProfile = new FirefoxProfile();
firefoxProfile.setPreference("browser.download.folderList",2);
firefoxProfile.setPreference("browser.download.manager.showWhenStarting",false);
firefoxProfile.setPreference("browser.download.dir","c:\\downloads");
firefoxProfile.setPreference("browser.helperApps.neverAsk.saveToDisk","text/csv");
WebDriver driver = new FirefoxDriver(firefoxProfile);
How can I set properties like browser.download.manager.showWhenStarting when using nightwatch?
From my understanding the only way to accomplish this is to create a profile before hand and use that profile in nightwatch configuration, similar to the insructions here: https://github.com/nightwatchjs/nightwatch/wiki/Enable-Firebug-in-Firefox-for-Nightwatch-tests
I wish there was a way to set firefox preferences, since with the solution I'm providing your tests are dependent on running on the machine with the profile.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With