Is there a way to set Firefox preferences in nightwatch? I am trying to achieve the same thing in Java using nightwatch.
To set Firefox preferences in nightwatch, you can use the following code snippet:
FirefoxProfile profile = new FirefoxProfile();
profile.setPreference("intl.accept_languages", "de");
WebDriver driver = new FirefoxDriver(profile);
I have successfully implemented this in Chrome, but I'm struggling to do the same in Firefox.
For setting preferences in Chrome, you can use the following desired capabilities in your nightwatch configuration:
"desiredCapabilities": {
"browserName": "chrome",
"javascriptEnabled": true,
"acceptSslCerts": true,
"chromeOptions" :{
"prefs": {
"intl.accept_languages":"fr"
}
}
}
Any help on how to set Firefox preferences would be greatly appreciated! Thank you.