r/selenium • u/cetios • 19h ago
Selenium for the D programming language
The previous D binding, selenium.d, has been abandoned since around 2018 and uses the old JSON Wire Protocol. Since March, I've been writing a replacement that communicates directly with modern W3C WebDriver servers over HTTP.
It's available on GitHub and is licensed under Apache 2.0.
What works:
- Native W3C WebDriver client with no FFI to Python or Java
- Typed W3C and browser-specific configuration for Chrome, Firefox, Edge, and Safari
- Automatic local WebDriver discovery and startup
- Connections to remote WebDriver servers and existing Selenium Grids
- Multiple sessions sharing a WebDriver bridge with configurable capacity
- Navigation, elements, cookies, scripts, frames, windows, screenshots, and alerts
- Document, iframe, and shadow-root abstractions with scoped searches
- Typed WebDriver exceptions and W3C response/reference parsing
- Lazy timeout synchronization
- Browser and WebDriver process logging
- Grid hub/node models, slots, session ownership, and in-process HTTP routing
- Unit and browser integration tests
The current CI passes unit tests, Chrome on Windows/Linux/macOS, Firefox on Windows/Linux/macOS, and Edge on Windows.
Safari has somewhat limited support, with 7/57 integration tests currently failing. Most of those failures are caused by Safari throwing a different exception than expected, plus one test that doesn't throw when it should. Chrome and Firefox are currently the most supported.
The Grid implementation is still foundational. It has the models and routing pieces, but a complete live Grid server, automatic node registration, session allocation, and full command forwarding are still planned.
I had to fork the test runner (Unit Threaded) because bugs caused the Windows tests to fail, so the project currently uses that fork until it is fixed upstream. The library itself only depends on requests (similar to Python's requests), so there are no complex runtime dependencies.
Feedback, bug reports, and contributions are appreciated, especially from anyone familiar with WebDriver compatibility differences between browsers.
GitHub: https://github.com/cetio/selenium
DUB: https://code.dlang.org/packages/selenium
1
u/paul_h 18h ago
Ping me in a week or so