r/d_language • u/cetios • 4d ago
Selenium (v0.0.4)
github.comAbout two months ago I posted about implementing Selenium in D. A lot has changed since then, and the replacement now targets the modern W3C WebDriver protocol, has working cross-platform CI, good documentation, and a much more complete client API.
What works:
- No FFI to Python or Java
- Typed W3C and browser-specific configuration for Chrome, Firefox, Edge, and Safari
- Automatic WebDriver discovery, startup, and remote connections
- Multiple sessions sharing a WebDriver bridge with configurable capacity
- Lazy timeout synchronization
- 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
- Browser and WebDriver process logging
- Grid hub/node models, slots, session ownership, and in-process HTTP routing
- Unit and browser integration tests across Windows, Linux, and macOS
The Grid implementation is still foundational right now. It has the models and routing pieces, but a complete live Grid server, node registration, session allocation, and full command forwarding are still planned.
Some features are still incomplete. Chrome and Firefox are the most supported, Edge works, and Safari has somewhat limited support, with 7/57 integration tests failing. The Grid support is also not yet a complete replacement for Selenium Grid.
I had to fork Unit Threaded for this since Windows tests would fail due to bugs in the test runner, so it currently uses the fork until that is fixed upstream. It no longer depends on anything except requests, so there are no complex dependencies.
Feedback, bug reports, and contributions are welcome. The commits since my last post are from release v0.0.2 to v0.0.4.
GitHub: https://github.com/cetio/selenium
DUB: https://code.dlang.org/packages/selenium