unable to run Htmlunit application using Maven dependency

倖福魔咒の 提交于 2019-12-07 00:38:37

You need to remove the direct HttpClient dependency, because it is already referenced by HtmlUnit by a newer version.

    <dependency>
        <groupId>commons-httpclient</groupId>
        <artifactId>commons-httpclient</artifactId>
        <version>3.1</version>
    </dependency>

You can see the used versions in eclipse:

Ahmed Neinae
WebDriver driver = new new HtmlUnitDriver(true);

Add these dependencies

<dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-java</artifactId>
    <version>2.52.0</version>
</dependency>
<dependency>
    <groupId>org.apache.httpcomponents</groupId>
    <artifactId>httpclient</artifactId>
    <version>4.5.2</version>
</dependency>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!