Skip to content

Repository files navigation

Selenium

License DUB Package Unit Tests

OS Chrome Firefox Edge Safari
Ubuntu Chrome / Ubuntu Firefox / Ubuntu
macOS Chrome / macOS Firefox / macOS Safari / macOS
Windows Chrome / Windows Firefox / Windows Edge / 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.

Installation

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.

Quick Start

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.

Documentation

Roadmap

WebDriver protocol

  • 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

Client API

  • 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

Grid

  • Live HTTP transport for hubs and nodes
  • Node registration, heartbeat, draining, and removal
  • Capability matching, session allocation, and command forwarding

Quality

  • Grid server and client (multi-session routing) tests
  • W3C WebDriver compliance tests
  • More than 70% code coverage for every source file

License

Selenium is licensed under Apache-2.0.

About

Browser automation with WebDriver lifecycle, element interaction, JavaScript execution, and multi-browser support.

Topics

Resources

Contributing

Stars

3 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages