Firefox allows selenium to load specific Profiles and/or Browser Preferences. In selenium 4 and later versions of selenium 3 it is expected to use moz:firefoxOptions, read more here: firefoxOptions.
Before adding anything to your test try and determine if you want to modify a Preference or a Profile:
Preferences:
Stuff that lives under "about:config"
Profile:
Stuff that lives under "about:profiles"
0. Find important preferences in the Firefox page about:config. Read more here: https://developer.mozilla.org/en-US/docs/Web/WebDriver/Capabilities/firefoxOptions
Quick Fix for Preferences:
- Create a user.js file. Read more about user.js files:https://developer.mozilla.org/en-US/docs/Mozilla/Preferences
- Fill user.js with your preferences
- Zip the user.js file
- Base64 encode your user.js.zip file
- Add the base64 string to the selenium capability moz:firefoxOptions: { 'profile': "your-base64-string-here" }
Preferences Alternative:
Alternatively you can add key-value entry for your preferences to
moz:firefoxOptions: {
'prefs': {
prefKey: some.preference.here
}
}