Giter Site home page Giter Site logo

htmlunit-driver's Introduction

HtmlUnitDriver Logo

HtmlUnitDriver is a WebDriver compatible driver for the HtmlUnit headless browser.

Maven Central

News

Twitter

Build Status

HtmlUnit Remote - Selenium 4 Grid support

Please have a look at the HtmlUnit Remote project if you like to use this driver from Selenium 4 Grid.

Get it!

An overview of the different versions, the HtmlUnit version used in each case and the compatibility can be found in these tables.

Maven

Simply add a dependency on the latest htmlunit3-driver version available in the Maven Central.

Add to your pom.xml:

<dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>htmlunit3-driver</artifactId>
    <version>4.23.0</version>
</dependency>

Gradle

Add to your build.gradle:

implementation group: 'org.seleniumhq.selenium', name: 'htmlunit3-driver', version: '4.23.0'

Usage

Simple

You can simply use one of the constructors from the HtmlUnit driver class

// simple case - no javascript support
WebDriver webDriver = new HtmlUnitDriver();
// specify the browser - no javascript support
WebDriver webDriver = new HtmlUnitDriver(BrowserVersion.FIREFOX);
// simple case - javascript support enabled
WebDriver webDriver = new HtmlUnitDriver(true);
// specify the browser - javascript support enabled
WebDriver webDriver = new HtmlUnitDriver(BrowserVersion.FIREFOX, true);

Customization

HtmlUnit offers many customization options. Similar to the other WebDriver's the class HtmlUnitDriverOptions can be used to customize your HtmlUnit driver.

final HtmlUnitDriverOptions driverOptions = new HtmlUnitDriverOptions(BrowserVersion.FIREFOX);

// configure e.g.
driverOptions.setCapability(HtmlUnitOption.optThrowExceptionOnScriptError, false);

HtmlUnitDriver webDriver = new HtmlUnitDriver(driverOptions);
// use the driver

Please check the

Selenium compatibility

An overview of the different versions, the HtmlUnit version used in each case and the compatibility can be found in these tables.

License

HtmlUnitDriver is distributed under Apache License 2.0.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.