Skip to content

Commit 66db05e

Browse files
committed
update configuration and mention htmlunit remote project
1 parent 499546f commit 66db05e

File tree

1 file changed

+23
-25
lines changed

1 file changed

+23
-25
lines changed

README.md

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,16 @@ HtmlUnitDriver is a WebDriver compatible driver for the [HtmlUnit](https://www.h
99

1010
[![Build Status](https://jenkins.wetator.org/buildStatus/icon?job=HtmlUnitDriver+-+Selenium+4)](https://jenkins.wetator.org/view/HtmlUnit%20Driver/job/HtmlUnitDriver%20-%20Selenium%204/)
1111

12-
## Download and Installation
12+
## HtmlUnit Remote - Selenium 4 Grid support
1313

14-
There are two versions available
14+
Please have a look at the **[HtmlUnit Remote](https://github.com/sbabcoc/htmlunit-remote)** project if you like to use this driver from [Selenium 4 Grid](https://www.selenium.dev/documentation/grid).
1515

16-
### Selenium compatibility
1716

18-
Starting with Selenium 4.5 we use the same version numbers for the driver - e.g. HtmlUnit-Driver 4.22.0
19-
is for Selenium 4.22.0.
17+
## Get it!
2018

2119
An overview of the different versions, the HtmlUnit version used in each case and the compatibility
2220
can be found in these [tables](compatibility.md).
2321

24-
25-
## Get it!
26-
2722
### Maven
2823

2924
Simply add a dependency on the latest `htmlunit3-driver` version available in the Maven Central.
@@ -34,7 +29,7 @@ Add to your `pom.xml`:
3429
<dependency>
3530
<groupId>org.seleniumhq.selenium</groupId>
3631
<artifactId>htmlunit3-driver</artifactId>
37-
<version>4.22.0</version>
32+
<version>4.23.0</version>
3833
</dependency>
3934
```
4035

@@ -43,7 +38,7 @@ Add to your `pom.xml`:
4338
Add to your `build.gradle`:
4439

4540
```groovy
46-
implementation group: 'org.seleniumhq.selenium', name: 'htmlunit3-driver', version: '4.22.0'
41+
implementation group: 'org.seleniumhq.selenium', name: 'htmlunit3-driver', version: '4.23.0'
4742
```
4843

4944

@@ -74,27 +69,30 @@ WebDriver webDriver = new HtmlUnitDriver(BrowserVersion.FIREFOX, true);
7469
```
7570

7671

77-
### More customization
72+
### Customization
7873

79-
HtmlUnit offers a lot more customization options. To adjust these options you can use this pattern.
74+
HtmlUnit offers many customization options.
75+
Similar to the other WebDriver's the class HtmlUnitDriverOptions can be used to customize your HtmlUnit driver.
8076

8177
```java
82-
WebDriver webDriver = new HtmlUnitDriver(BrowserVersion.FIREFOX, true) {
83-
@Override
84-
protected WebClient modifyWebClient(WebClient client) {
85-
final WebClient webClient = super.modifyWebClient(client);
86-
// you might customize the client here
87-
webClient.getOptions().setCssEnabled(false);
88-
89-
return webClient;
90-
}
91-
};
78+
final HtmlUnitDriverOptions driverOptions = new HtmlUnitDriverOptions(BrowserVersion.FIREFOX);
79+
80+
// configure e.g.
81+
driverOptions.setCapability(HtmlUnitOption.optThrowExceptionOnScriptError, false);
82+
83+
HtmlUnitDriver webDriver = new HtmlUnitDriver(driverOptions);
84+
// use the driver
9285
```
9386

94-
And for some special cases you and also overwrite the method newWebClient(final BrowserVersion version) to
95-
adjust the webClient before the standard WebDriver setup takes place or for constructing your
96-
own webClient.
87+
Please check the
88+
89+
### Selenium compatibility
90+
91+
Starting with Selenium 4.5 we use the same version numbers for the driver - e.g. HtmlUnit-Driver 4.23.0
92+
is for Selenium 4.23.0.
9793

94+
An overview of the different versions, the HtmlUnit version used in each case and the compatibility
95+
can be found in these [tables](compatibility.md).
9896

9997
## License
10098

0 commit comments

Comments
 (0)