geckodriver =========== Proxy for using W3C WebDriver-compatible clients to interact with Gecko-based browsers. This program provides the HTTP API described by the [WebDriver protocol] to communicate with Gecko browsers, such as Firefox. It translates calls into the [Firefox remote protocol] by acting as a proxy between the local- and remote ends. You can consult the [change log] for a record of all notable changes to the program. [Releases] are made available on GitHub on [supported platforms]. The canonical source code repository for geckodriver now lives in [mozilla-central] under [testing/geckodriver]. You can read more about [working with Mozilla source code] on MDN. This means we do no longer accept pull requests on GitHub. Patches should be uploaded to a bug in the [Testing :: GeckoDriver] component. [WebDriver protocol]: http://w3c.github.io/webdriver/webdriver-spec.html#protocol [Firefox remote protocol]: https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette [change log]: https://github.com/mozilla/geckodriver/blob/master/CHANGES.md [Releases]: https://github.com/mozilla/geckodriver/releases [supported platforms]: #supported-firefoxen [mozilla-central]: https://hg.mozilla.org/mozilla-central/ [testing/geckodriver]: https://hg.mozilla.org/mozilla-central/file/tip/testing/geckodriver [working with Mozilla source code]: https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Source_Code [Testing :: geckodriver]: https://bugzilla.mozilla.org/buglist.cgi?product=Testing&component=geckodriver&resolution=---&list_id=13613952 Supported clients ================= [Selenium] users must update to [version 3.5] or later to use geckodriver. Other clients that follow the [W3C WebDriver specification] are also supported. [version 3.5]: https://github.com/SeleniumHQ/selenium/releases/tag/selenium-3.5.0 [W3C WebDriver specification]: https://w3c.github.io/webdriver/webdriver-spec.html Supported Firefoxen =================== geckodriver is not yet feature complete. This means that it does not yet offer full conformance with the [WebDriver] standard or complete compatibility with [Selenium]. You can track the [implementation status] of the latest [Firefox Nightly](http://whattrainisitnow.com/) on [MDN]. We also keep track of known [Selenium], [remote protocol], and [specification] problems in our [issue tracker]. Support is best in Firefox 55 and greater, although generally the more recent the Firefox version, the better the experience as they have more bug fixes and features. Some features will only be available in the most recent Firefox versions, and we strongly advise using the latest [Firefox Nightly] with geckodriver. Since Windows XP support in Firefox was dropped with Firefox 53, we do not support this platform. [implementation status]: https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver/status [MDN]: https://developer.mozilla.org/ [selenium]: https://github.com/mozilla/geckodriver/issues?q=is%3Aissue+is%3Aopen+label%3Aselenium [remote protocol]: https://github.com/mozilla/geckodriver/issues?q=is%3Aissue+is%3Aopen+label%3Amarionette [specification]: https://github.com/mozilla/geckodriver/issues?q=is%3Aissue+is%3Aopen+label%3Aspec [issue tracker]: https://github.com/mozilla/geckodriver/issues [Firefox Nightly]: https://nightly.mozilla.org/ WebDriver capabilities ====================== geckodriver supports a number of [capabilities]: [capabilities]: https://w3c.github.io/webdriver/webdriver-spec.html#capabilities
Name | Type | Default | Description |
---|---|---|---|
acceptInsecureCerts
| boolean | Boolean initially set to false, indicating the session will not implicitly trust untrusted or self-signed TLS certificates on navigation. | |
pageLoadStrategy
| string | Defines the page load strategy
to use for the duration of the session.
Setting a page load strategy will cause navigation
to be "eager ",
waiting for the interactive document ready state;
"normal " (the default),
waiting for the complete ready state;
or "none ",
which will return immediately after starting navigation.
| |
proxy
| proxy object
| Sets browser proxy settings. |
Name | Type | Description |
---|---|---|
proxyType
| string | Indicates the type of proxy configuration.
This value must be one of
pac ,
direct ,
autodetect ,
system ,
or manual .
|
proxyAutoconfigUrl
| string | Defines the URL for a proxy auto-config file.
This property should only be set
when proxyType is pac .
|
ftpProxy
| string | Defines the proxy hostname with an optional port for FTP traffic.
This property should only be set when proxyType
is set to manual .
|
httpProxy
| string | Defines the proxy hostname with an optional port for HTTP traffic.
This property should only be set when proxyType
is set to manual .
|
noProxy
| list | Lists the addresses for which the proxy should be bypassed.
This property should only be set when proxyType
is set to manual .
|
sslProxy
| string | Defines the proxy hostname with an optional port for encrypted TLS traffic.
This property should only be set when proxyType
is set to manual .
|
socksProxy
| string | Defines the hostname with on optional port for a SOCKS proxy.
This property should only be set when proxyType
is set to manual .
|
socksVersion
| number | Defines the SOCKS proxy version. This property has only to be set
when proxyType is set to manual .
|
Name | Type | Description |
---|---|---|
binary
| string | Absolute path of the Firefox binary,
e.g. /usr/bin/firefox
or /Applications/Firefox.app/Contents/MacOS/firefox ,
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 ( To have geckodriver pick up an existing profile on the filesystem,
you may pass |
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 Profiles are created in the system’s temporary folder.
This is also where the encoded profile is extracted
when The effective profile in use by the WebDriver session
is returned to the user in the To have geckodriver pick up an existing profile on the filesystem,
please set the |
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. |
Name | Type | Description |
---|---|---|
level
| string | Set the level of verbosity of geckodriver and Firefox.
Available levels are trace ,
debug , config ,
info , warn ,
error , and fatal .
If left undefined the default is info .
|
Name | Type | Description |
---|---|---|
preference name | string, number, boolean | One entry per preference to override. |
-b BINARY
/--binary BINARY
Path to the Firefox binary to use. By default geckodriver tries to find
and use the system installation of Firefox, but that behaviour can be
changed by using this option. Note that the `binary` capability of the
`moz:firefoxOptions` object that is passed when [creating a new session]
will override this option.
On Linux systems it will use the first _firefox_ binary found by searching
the `PATH` environmental variable, which is roughly equivalent to calling
[whereis(1)] and extracting the second column:
% whereis firefox
firefox: /usr/bin/firefox /usr/local/firefox
On macOS, the binary is found by looking for the first _firefox-bin_
binary in the same fashion as on Linux systems. This means it is
possible to also use `PATH` to control where geckodriver should find
Firefox on macOS. It will then look for _/Applications/Firefox.app_.
On Windows systems, geckodriver looks for the system Firefox by scanning
the Windows registry.
[creating a new session]: https://w3c.github.io/webdriver/webdriver-spec.html#new-session
[whereis(1)]: http://www.manpagez.com/man/1/whereis/
#### `--connect-existing`
Connecting to an existing Firefox instance. The instance must have
Marionette enabled.
To enable the Marionette remote protocol you can pass the `--marionette`
flag to Firefox.
#### --host HOST
Host to use for the WebDriver server. Defaults to 127.0.0.1.
#### --log LEVEL
Set the Gecko and geckodriver log level. Possible values are `fatal`,
`error`, `warn`, `info`, `config`, `debug`, and `trace`.
#### --marionette-port PORT
Port to use for connecting to the Marionette remote protocol. By default
it will pick a free port assigned by the system.
#### -p PORT
/--port PORT
Port to use for the WebDriver server. Defaults to 4444.
A helpful trick is that it is possible to bind to 0 to get the system
to atomically assign a free port.
#### -v[v]
Increases the logging verbosity by to debug level when passing a single
`-v`, or to trace level if `-vv` is passed. This is analogous to passing
`--log debug` and `--log trace`, respectively.
Building
========
geckodriver is written in [Rust], a systems programming language from
[Mozilla]. Crucially, it relies on the [webdriver crate] to provide
the HTTPD and do most of the heavy lifting of marshalling the WebDriver
protocol. geckodriver translates WebDriver [commands], [responses],
and [errors] to the [Marionette protocol], and acts as a proxy between
[WebDriver] and [Marionette].
geckodriver is built in the [Firefox CI] by default but _not_ if you
build Firefox locally. To enable building of geckodriver locally,
ensure you put this in your [mozconfig]:
ac_add_options --enable-geckodriver
You build geckodriver with the `./mach build testing/geckodriver`
command, run tests with `./mach test testing/geckodriver`, and run
the built executable with `./mach geckodriver -- --other --flags`.
[Rust]: https://www.rust-lang.org/
[Mozilla]: https://www.mozilla.org/en-US/
[webdriver crate]: https://github.com/mozilla/webdriver-rust
[commands]: https://docs.rs/webdriver/0.25.0/webdriver/command/index.html
[responses]: https://docs.rs/webdriver/0.25.0/webdriver/response/index.html
[errors]: https://docs.rs/webdriver/0.25.0/webdriver/error/enum.ErrorStatus.html
[Marionette protocol]: https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/Protocol
[WebDriver]: https://w3c.github.io/webdriver/webdriver-spec.html
[FirefoxDriver]: https://github.com/SeleniumHQ/selenium/wiki/FirefoxDriver
[Marionette]: http://searchfox.org/mozilla-central/source/testing/marionette/README
[Firefox CI]: https://treeherder.mozilla.org/
[mozconfig]: https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Configuring_Build_Options
Contact
=======
The mailing list for geckodriver discussion is
tools-marionette@lists.mozilla.org ([subscribe], [archive]).
There is also an IRC channel to talk about using and developing
geckodriver in #ateam on irc.mozilla.org.
[subscribe]: https://lists.mozilla.org/listinfo/tools-marionette
[archive]: https://groups.google.com/group/mozilla.tools.marionette