Selenium 3.0.x with HTMLUnitDriver
Asked Answered
H

1

7

I have selenium-java 3.0.1 in my Maven project. I have read that this version does not come packaged with HTMLUnitDriver. So, I have separately included selenium-htmlunit-driver 2.52.0 in my pom (the latest version available). However, when I do this, I get the following exception on test run:

org.openqa.selenium.WebDriverException: java.lang.IllegalArgumentException: Cannot locate declared field class org.apache.http.impl.client.HttpClientBuilder.sslcontext

According to this link, including the selenium-java and selenium-htmlunit-driver dependencies should be sufficient. In some scenarios, the standalone server may need to be included as well, which is not the case for my project. I tried it anyway, and that didn't work either.

selenium-htmlunit-driver 2.52.0 is internally dependent on org.apache.httpcomponents 4.5.1.

selenium-java 2.47.0 uses htmlunit-driver 2.47.0 which uses org.apache.httpcomponents 4.4.1. When I use these versions, everything works correctly.

So my question is, can HTMLUnitDriver not be used with Selenium 3.0.x at all? Or is my understanding completely wrong here?

Humorous answered 8/11, 2016 at 17:13 Comment(0)
R
1

Selenium has changed artifact id. Use htmlunit-driver instead.

<dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>htmlunit-driver</artifactId>
    <version>2.23.2</version>
</dependency>

See also: https://github.com/SeleniumHQ/htmlunit-driver

Rasbora answered 21/12, 2016 at 12:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.