Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set Firefox preferences when using nightwatch

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?

like image 929
user1929819 Avatar asked Nov 27 '25 11:11

user1929819


1 Answers

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.

like image 60
Madison Haynie Avatar answered Nov 30 '25 06:11

Madison Haynie



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!