Firefox-specific WebDriver capabilities

Jump to:

The moz:firefoxOptions capability is a namespaced set of capabilities specific to Firefox.

It is a dictionary used to define options which control how Firefox gets started and run. It may contain any of the following fields:

binary (string)
Absolute path of the Firefox binary, e.g. /usr/bin/firefox or /Applications/, to select which custom browser binary to use. If left undefined geckodriver will attempt to deduce the default location of Firefox on the current system.
args (array of strings)

Command line arguments to pass to the Firefox binary. These must include the leading dash (-) where required, e.g. ["-devtools"].

To have geckodriver pick up an existing profile on the filesystem, you may pass ["-profile", "/path/to/profile"].

profile (string)

Base64-encoded ZIP of a profile directory to use for the Firefox instance. This may be used to e.g. install extensions or custom certificates, but for setting custom preferences we recommend using the prefs entry instead of passing a profile.

Profiles are created in the system’s temporary folder. This is also where the encoded profile is extracted when profile is provided. By default, geckodriver will create a new profile in this location.

The effective profile in use by the WebDriver session is returned to the user in the moz:profile capability in the new session response.

To have geckodriver pick up an existing profile on the filesystem, please set the args field to {"args": ["-profile", "/path/to/your/profile"]}.

log (log object)
To increase the logging verbosity of geckodriver and Firefox, you may pass a log object that may look like {"log": {"level": "trace"}} to include all trace-level logs and above
prefs (prefs object)
Map of preference name to preference value, which can be a string, a boolean or an integer.

log object


prefs object




See also

Document Tags and Contributors

Contributors to this page: ato
Last updated by: ato,