Skip to content

Commit a9ab0a7

Browse files
committed
Add information to README
1 parent 81b95dc commit a9ab0a7

File tree

1 file changed

+34
-2
lines changed

1 file changed

+34
-2
lines changed

README.md

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,34 @@
1-
# htmlunit-remote
2-
Remote wrapper for HtmlUnitDriver
1+
# INTRODUCTION
2+
**HtmlUnit Remote** is driver service for [HtmlUnitDriver](https://github.com/SeleniumHQ/htmlunit-driver) that enables you to acquire driver sessions from [Selenium 4 Grid](https://www.selenium.dev/documentation/grid).
3+
4+
### Background
5+
6+
**Selenium 3 Grid** could be configured to supply **HtmlUnitDriver** sessions, supported by special-case handling within the Node server itself. This handling was not carried over into **Selenium 4 Grid**, which was completely re-engineered with new architecture and vastly expanded capabilities.
7+
8+
To eliminate behavioral differences between local and remote configurations, the [Selenium Foundation](https://github.com/sbabcoc/Selenium-Foundation) framework always acquires browser sessions from a **Grid** instance, managing a local grid instance when not configured to use an existing instance. The lack of **HtmlUnitDriver** support in **Selenium 4 Grid** necessitated reconfiguring the project unit tests from using this Java-only managed artifact to using a standard browser like Chrome, an external dependency that requires additional resources and imposes additional risks of failure.
9+
10+
The driver service implemented by **HtmlUnit Remote** enables **Selenium 4 Grid** to supply **HtmlUnitDriver** session.
11+
12+
### Implementation Details
13+
14+
**HtmlUnit Remote** provides the following elements:
15+
* **HtmlUnitDriverInfo** - This class informs **Selenium 4 Grid** that **HtmlUnitDriver** is available and provides a method to create new driver instances.
16+
* **HtmlUnitDriverService** - This class manages a server that hosts instances of **HtmlUnitDriver**.
17+
* **HtmlUnitDriverServer** - This is the server class that hosts **HtmlUnitDriver** instances. It implements the [W3C WebDriver protocol](https://www.w3.org/TR/webdriver2):
18+
* Create new driver sessions
19+
* Route driver commands to specified driver sessions
20+
* Assemble driver method results into HTTP responses
21+
22+
In operation, **HtmlUnitDriverService** is instantiated by **Selenium 4 Grid** node servers that are configured to support **HtmlUnitDriver**. Unlike other driver services, which launch a new process for each created driver session, **HtmlUnitDriverService** starts a single in-process server that hosts all of the driver sessions it creates.
23+
24+
### Grid Configuration
25+
26+
```
27+
[node]
28+
detect-drivers = false
29+
[[node.driver-configuration]]
30+
display-name = "HtmlUnit"
31+
stereotype = "{\"browserName\": \"htmlunit\"}"
32+
```
33+
34+
> Written with [StackEdit](https://stackedit.io/).

0 commit comments

Comments
 (0)