mozilla/gecko-dev
Geckodriver
geckodriver is the W3C WebDriver server for Firefox: a small Rust HTTP server that translates WebDriver JSON commands into Marionette / WebDriver BiDi messages handled inside the running Firefox. Lives in testing/geckodriver/.
Purpose
External tools (Selenium, Cypress, etc.) speak to geckodriver over HTTP; geckodriver then drives Firefox via the Marionette protocol implemented in testing/marionette/ and the WebDriver BiDi server in remote/webdriver-bidi/.
Directory layout
testing/geckodriver/
├── Cargo.toml
├── src/
│ ├── main.rs # Entry point + arg parsing
│ ├── marionette.rs # Marionette client transport
│ ├── browser.rs # Firefox process management
│ ├── capabilities.rs # WebDriver capabilities matching
│ ├── command.rs # Command translation
│ ├── logging.rs # Log levels and routing
│ └── ...
├── doc/ # Project docs
├── webdriver/ # Shared types pulled from the webdriver crate
└── tests/How it works
sequenceDiagram
participant Test as Test (Selenium, etc.)
participant GD as geckodriver
participant FF as Firefox
participant Mn as Marionette
Test->>GD: HTTP POST /session {...}
GD->>FF: spawn process
GD->>Mn: TCP connect (Marionette port)
Test->>GD: HTTP POST /session/{id}/url {url}
GD->>Mn: WebDriver:Navigate {url}
Mn-->>GD: ack
GD-->>Test: 200 OKGeckodriver is a workspace member in the top-level Cargo.toml.
Building and running
cd testing/geckodriver
cargo build --release
./target/release/geckodriver --versionIn CI, geckodriver is built as part of the standard ./mach build along with the rest of the workspace crates and packaged separately.
Related
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.