webdriver-installer


License

License

GroupId

GroupId

com.samuraism
ArtifactId

ArtifactId

webdriver-installer
Last Version

Last Version

1.4
Release Date

Release Date

Type

Type

pom.sha512
Description

Description

webdriver-installer
webdriver-installer
Source Code Management

Source Code Management

https://github.com/Samuraism/webdriver-installer

Download webdriver-installer

Dependencies

compile (1)

Group / Artifact Type Version
org.apache.commons : commons-compress jar 1.20

Project Modules

There are no modules declared in this project.

#weberiverInstaller

webdriver-installer is a utility which detects the version of the installed Google Chrome, or Firefox and installs appropriate version of web driver in the specified location.

hashtag

#weberiverInstaller

System Requirements

Java: Java 8+

OS: Windows, Linux, macOS

Adding webdriver-installer to your project

This library is available at the Maven Central Repository

Maven Central

Maven

<dependencies>
    <dependency>
        <groupId>com.samuraism</groupId>
        <artifactId>webdriver-installer</artifactId>
        <version>1.4</version>
    </dependency>
</dependencies>

Gradle

dependencies {
    compile 'com.samuraism:webdriver-installer:1.4'
}

How to use

Call Chrome/GeckoDriver method to ensure the driver is installed at $HOME/chromedriver / $HOME/geckodriver You can specify the location via CHROME_DRIVER_HOME / GECKO_DRIVER_HOME environment variable, or chromedriver.home / geckodriver.home system property.

package yourpackage;

import com.samuraism.webdriverinstaller.WebDriverInstaller;

public class Example {
    public static void main(String[] args) {
        // install Chrome Driver in $HOME/chromedriver
        // "webdriver.chrome.driver" system property will be also set.
        Optional<String> chromeDriverPath = WebDriverInstaller.ensureChromeDriverInstalled();
        if (chromeDriverPath.isPresent()) {
            System.out.println("Chrome Driver is installed at:" + chromeDriverPath.get());
        } else {
            throw new ExceptionInInitializerError("Failed to install Chrome Driver");
        }

        // install geckodriver in $HOME/geckodriver
        // "webdriver.gecko.driver" system property will be also set.
        Optional<String> geckodriverPath = WebDriverInstaller.ensureGeckoDriverInstalled();
        if (geckodriverPath.isPresent()) {
            System.out.println("geckodriver is installed at:" + geckodriverPath.get());
        } else {
            throw new ExceptionInInitializerError("Failed to install geckodriver");
        }
    }
}

License

Apache License Version 2.0

Java CI with Gradle

com.samuraism

Versions

Version
1.4