Skip to content

Commit 51d9067

Browse files
committed
fix: Drop deprecated htmlunit driver
BREAKING CHANGE: HtmlUnit was removed from Selenium, so this project will also drop support
1 parent 6ed78eb commit 51d9067

File tree

3 files changed

+2
-11
lines changed

3 files changed

+2
-11
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@
142142
</dependency>
143143
<dependency>
144144
<groupId>org.seleniumhq.selenium</groupId>
145-
<artifactId>htmlunit3-driver</artifactId>
145+
<artifactId>selenium-chrome-driver</artifactId>
146146
<version>${selenium.version}</version>
147147
</dependency>
148148
<dependency>

zap-client-api/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
</dependency>
102102
<dependency>
103103
<groupId>org.seleniumhq.selenium</groupId>
104-
<artifactId>htmlunit3-driver</artifactId>
104+
<artifactId>selenium-chrome-driver</artifactId>
105105
</dependency>
106106
<dependency>
107107
<groupId>com.codeborne</groupId>

zap-client-api/src/main/java/net/cst/zap/api/authentication/WebDriverFactory.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import org.openqa.selenium.chrome.ChromeOptions;
99
import org.openqa.selenium.firefox.FirefoxDriver;
1010
import org.openqa.selenium.firefox.FirefoxOptions;
11-
import org.openqa.selenium.htmlunit.HtmlUnitDriver;
1211

1312
public final class WebDriverFactory {
1413

@@ -19,8 +18,6 @@ public static WebDriver makeWebDriver(ZapInfo zapInfo, AuthenticationInfo authen
1918
int port = zapInfo.getPort();
2019

2120
switch (authenticationInfo.getSeleniumDriver()) {
22-
case HTMLUNIT:
23-
return makeHtmlUnitDriver(host, port);
2421
case FIREFOX:
2522
return makeFirefoxDriver(host, port);
2623
case CHROME:
@@ -30,12 +27,6 @@ public static WebDriver makeWebDriver(ZapInfo zapInfo, AuthenticationInfo authen
3027
}
3128
}
3229

33-
public static HtmlUnitDriver makeHtmlUnitDriver(String host, int port) {
34-
HtmlUnitDriver driver = new HtmlUnitDriver();
35-
driver.setProxy(host, port);
36-
return driver;
37-
}
38-
3930
public static FirefoxDriver makeFirefoxDriver(String host, int port) {
4031
FirefoxOptions profile = new FirefoxOptions();
4132
profile.setCapability("network.proxy.type", FIREFOX_MANUAL_PROXY_CONFIGURATION_OPTION);

0 commit comments

Comments
 (0)