| OS | Chrome | Firefox | Edge | Safari |
|---|---|---|---|---|
| Ubuntu | ||||
| macOS | ||||
| Windows |
Selenium is a native D implementation of the W3C WebDriver protocol. It drives Chrome, Firefox, Edge, and Safari directly over HTTP, with no external language bindings or C wrappers. The API often mirrors the Selenium Ruby bindings, so it should be familiar to existing Selenium users.
Add the complete package or a specific subpackage with DUB:
dub add selenium
dub add selenium:webdriver
dub add selenium:grid| Package | Contents |
|---|---|
selenium |
WebDriver and Grid modules. |
selenium:webdriver |
Bridge, driver, browser capabilities, elements, roots, cookies, and logging. |
selenium:grid |
Grid models, hub and node scaffolding, and in-process HTTP routing. |
The Grid package currently provides models and routing primitives, not a live HTTP server or a complete session distributor.
Install the browser and matching WebDriver executable, then ensure the driver is on PATH:
| Browser | WebDriver executable |
|---|---|
| Chrome | chromedriver |
| Firefox | geckodriver |
| Edge | msedgedriver |
| Safari | safaridriver |
import selenium;
import std.stdio : writeln;
Driver driver = Driver.start(new Chrome());
scope (exit) driver.stop();
driver.go("https://example.com");
writeln(driver.title);Driver.start() can instead select the first known WebDriver executable found on PATH. The library does not download browsers or drivers.
- Fix Safari support (see integration tests)
- Asynchronous script execution (
POST /execute/async) - Actions API, including perform and release
- Alert text, accept, dismiss, and prompt input commands
- Computed accessibility role and label accessors
- Page printing (
POST /print) - First-class timeout retrieval and updates
- Full window rectangle support, including window position
- Explicit waits with reusable expected conditions
- Special keys such as Enter, Tab, Escape, and arrows for
sendKeys - Convenience locators such as id, name, and class name
- Element display state (
isDisplayed) - Select-element helper
- Live HTTP transport for hubs and nodes
- Node registration, heartbeat, draining, and removal
- Capability matching, session allocation, and command forwarding
- Grid server and client (multi-session routing) tests
- W3C WebDriver compliance tests
- More than 70% code coverage for every source file
Selenium is licensed under Apache-2.0.