# htmlunit-driver **Repository Path**: mirrors_andyglick/htmlunit-driver ## Basic Information - **Project Name**: htmlunit-driver - **Description**: WebDriver compatible driver for HtmlUnit headless browser. - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-03-28 - **Last Updated**: 2026-02-21 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # HtmlUnitDriver HtmlUnitDriver is a WebDriver compatible driver for the [HtmlUnit](http://htmlunit.sourceforge.net/) headless browser. [![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.seleniumhq.selenium/htmlunit-driver/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.seleniumhq.selenium/htmlunit-driver) ##### News [Twitter](https://twitter.com/HtmlUnit) [![Build Status](https://jenkins.wetator.org/buildStatus/icon?job=HtmlUnitDriver)](https://jenkins.wetator.org/job/HtmlUnitDriver/) ## Download and Installation ### Maven/Gradle/... Add a dependency on the latest `htmlunit-driver` version available in the Maven Central, please note that both `artifactId` and `version` are changed to match the dependent HtmlUnit version: ```xml org.seleniumhq.selenium htmlunit-driver 2.47.1 ``` ## Usage ### Simple You can simply use one of the constructors from the HtmlUnit driver class ```java // simple case - no javascript support WebDriver webDriver = new HtmlUnitDriver(); ``` ```java // specify the browser - no javascript support WebDriver webDriver = new HtmlUnitDriver(BrowserVersion.FIREFOX); ``` ```java // simple case - javascript support enabled WebDriver webDriver = new HtmlUnitDriver(true); ``` ```java // specify the browser - javascript support enabled WebDriver webDriver = new HtmlUnitDriver(BrowserVersion.FIREFOX, true); ``` ### More customization HtmlUnit offers a lot more customization options. To adjust these options you can use this pattern. ```java WebDriver webDriver = new HtmlUnitDriver(BrowserVersion.FIREFOX, true) { @Override protected WebClient modifyWebClient(WebClient client) { final WebClient webClient = super.modifyWebClient(client); // you might customize the client here webClient.getOptions().setCssEnabled(false); return webClient; } }; ``` And for some special cases you and also overwrite the method newWebClient(final BrowserVersion version) to adjust the webClient before the standard WebDriver setup takes place or for constructing your own webClient. ## License HtmlUnitDriver is distributed under Apache License 2.0.