SeleniumHQ / htmlunit-driver

WebDriver compatible driver for HtmlUnit headless browser.
Apache License 2.0
255 stars 86 forks source link

HtmlUnitDriver needs to provide WebDriverInfo and DriverService service providers for Selenium 4 Grid #134

Closed sbabcoc closed 2 months ago

sbabcoc commented 1 year ago

In order for Selenium 4 NodeOptions to resolve the "htmlunit" browser name to HtmlUnitDriver, it needs an implementation of the WebDriverInfo to provide the association. Without this service provider implementation, we get failures like the one shown in the attached Grid 4 server log.

org.openqa.selenium.grid.config.ConfigException: Unable to find matching driver for Capabilities {browserName: htmlunit, browserVersion: chrome, platformName: Windows 10}

grid-node-5.log

rbri commented 1 year ago

Will have a look, i guess i can implement WebDriverInfo for the next release

sbabcoc commented 1 year ago

We apparently also need an HtmlUnitDriverService, which extends org.openqa.selenium.remote.service.DriverService. This may be the more involved task, because it seems to require packaging up HtmlUnitDriver into a service that can launch and manage a separate process. With my own versions of these two classes, I've managed to launch and register an HtmlUnitDriver node in a local Grid 4 instance. I haven't tried to actually get a session yet, as the response I get back from a status request is malformed. I'll post further updates as the situation evolves.

sbabcoc commented 1 year ago

I abandoned my attempt to stand up a Grid 4 node that provides HtmlUnit sessions. I need to examine the InMemorySession feature of Selenium 3 to determine the size and complexity of the implementation.

sbabcoc commented 2 months ago

I've created the HtmlUnit Remote project to resolve this issue.