Automated driver management for Selenium WebDriver

Overview

Maven Central Build Status Quality Gate codecov badge-jdk License badge Backers on Open Collective Sponsors on Open Collective Support badge Twitter Follow

WebDriverManager is a library which allows to automate the management of the drivers (e.g. chromedriver, geckodriver, etc.) required by Selenium WebDriver.

Table of contents

  1. Motivation
  2. WebDriverManager as Java dependency
    1. Basic usage
    2. Examples
    3. Resolution cache
    4. WebDriverManager API
    5. Configuration
  3. WebDriverManager CLI
  4. WebDriverManager Server
  5. WebDriverManager Agent
  6. WebDriverManager Docker Container
  7. Known issues
  8. Help
  9. Backers
  10. Sponsors
  11. About

Motivation

If you use Selenium WebDriver, you probably know that to use some browsers such as Chrome, Firefox, Edge, Opera, PhantomJS, or Internet Explorer, first you need to download the so-called driver, i.e. a binary file which allows WebDriver to handle these browsers. In Java, the path to this driver should be set as JVM properties, as follows:

System.setProperty("webdriver.chrome.driver", "/path/to/chromedriver");
System.setProperty("webdriver.gecko.driver", "/path/to/geckodriver");
System.setProperty("webdriver.edge.driver", "/path/to/msedgedriver.exe");
System.setProperty("webdriver.opera.driver", "/path/to/operadriver");
System.setProperty("phantomjs.binary.path", "/path/to/phantomjs");
System.setProperty("webdriver.ie.driver", "C:/path/to/IEDriverServer.exe");

This is quite annoying since it forces you to link directly this driver into your source code. In addition, you have to check manually when new versions of the drivers are released. WebDriverManager comes to the rescue, performing in an automated way this job for you. WebDriverManager can be used in different ways:

  1. WebDriverManager as Java dependency (typically from test cases).
  2. WebDriverManager as Command Line Interface (CLI) tool (from the shell).
  3. WebDriverManager as Server (using a REST-like API).
  4. WebDriverManager as Agent (using Java instrumentation).
  5. WebDriverManager as Container (using Docker).

WebDriverManager is open-source, released under the terms of Apache 2.0 License.

WebDriverManager as Java dependency

Basic usage

To use WebDriverManager from tests in a Maven project, you need to add the following dependency in your pom.xml (Java 8 or upper required), typically using the test scope:

<dependency>
    <groupId>io.github.bonigarcia</groupId>
    <artifactId>webdrivermanager</artifactId>
    <version>4.3.1</version>
    <scope>test</scope>
</dependency>

... or in Gradle project:

dependencies {
    testImplementation("io.github.bonigarcia:webdrivermanager:4.3.1")
}

Once we have included this dependency, you can let WebDriverManager to do the driver management for you. Take a look at this JUnit 4 example which uses Chrome with Selenium WebDriver (to use WebDriverManager in conjunction with JUnit 5, the extension Selenium-Jupiter is highly recommended):

public class ChromeTest {

    private WebDriver driver;

    @BeforeClass
    public static void setupClass() {
        WebDriverManager.chromedriver().setup();
    }

    @Before
    public void setupTest() {
        driver = new ChromeDriver();
    }

    @After
    public void teardown() {
        if (driver != null) {
            driver.quit();
        }
    }

    @Test
    public void test() {
        // Your test code here
    }

}

Notice that simply adding WebDriverManager.chromedriver().setup(); WebDriverManager does magic for you:

  1. It checks the version of the browser installed in your machine (e.g. Chrome, Firefox).
  2. It matches the version of the driver (e.g. chromedriver, geckodriver). If unknown, it uses the latest version of the driver.
  3. It downloads the driver if it is not present on the WebDriverManager cache (~/.cache/selenium by default).
  4. It exports the proper WebDriver Java environment variables required by Selenium (not done when using WebDriverManager from the CLI or as a Server).

WebDriverManager resolves the drivers for the browsers Chrome, Firefox, Edge, Opera, PhantomJS, Internet Explorer, and Chromium. For that, it provides several drivers managers for these browsers. These drivers managers can be used as follows:

WebDriverManager.chromedriver().setup();
WebDriverManager.firefoxdriver().setup();
WebDriverManager.edgedriver().setup();
WebDriverManager.operadriver().setup();
WebDriverManager.phantomjs().setup();
WebDriverManager.iedriver().setup();
WebDriverManager.chromiumdriver().setup();

Moreover, WebDriverManager provides a generic driver manager. This manager which can be parameterized using Selenium driver classes (e.g. org.openqa.selenium.chrome.ChromeDriver, org.openqa.selenium.firefox.FirefoxDriver, etc), as follows:

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import io.github.bonigarcia.wdm.WebDriverManager;

// ...

Class<? extends WebDriver> driverClass = ChromeDriver.class;
WebDriverManager.getInstance(driverClass).setup();
WebDriver driver = driverClass.newInstance();

This generic driver manager can be also parameterized using the enumeration DriverManagerType. For instance as follows:

import static io.github.bonigarcia.wdm.DriverManagerType.CHROME;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import io.github.bonigarcia.wdm.WebDriverManager;

// ...

WebDriverManager.getInstance(CHROME).setup();
WebDriver driver = new ChromeDriver();

You can also use the DriverManagerType and get the complete driver class name. It might help you to create a browser instance without explicitly define the browser class.

import static io.github.bonigarcia.wdm.DriverManagerType.CHROME;

import org.openqa.selenium.WebDriver;
import io.github.bonigarcia.wdm.WebDriverManager;

// ...

DriverManagerType chrome = DriverManagerType.CHROME;
WebDriverManager.getInstance(chrome).setup();
Class<?> chromeClass =  Class.forName(chrome.browserClass());
driver = (WebDriver) chromeClass.newInstance();

Examples

The following repositories contains different examples using WebDriverManager:

Resolution cache

The relationship between browser version and driver version is managed in a internal database called resolution cache. As of WebDriverManager 4.0.0, this database is stored in a Java properties file called resolution.properties located by default in the cache folder (~/.cache/selenium). The validity of this relationship (browser version and driver version) is limited by a time-to-live (ttl) value. There are two kinds of TTLs. First, a TTL for driver versions, with a default value of 86400 seconds (i.e. 1 day). Second, a TTL for browser versions, with a default value of 3600 seconds (i.e. 1 hour).

To resolve the driver version for a given browser, first WebDriverManager try to find out the version of that browser. This mechanism depends on the browser (Chrome, Firefox, etc) and the platform (Linux, Windows, Mac). For instance, for Chrome in Linux, the command google-chrome --version is executed in the shell.

Then, WebDriverManager tries to determine which is the proper driver version for the detected browser version. To that aim, first the values of LATEST_RELEASE labels within the driver repositories are read. Besides, WebDriverManager maintains another properties file called versions.properties which maps the proper driver and browsers versions. To use always the latest relationships between browser and driver, the online version of versions.properties (master branch) is used. As alternative, the local version of this file (distributed within WebDriverManager) is used.

WebDriverManager API

WebDriverManager exposes its API by means of the builder pattern. This means that given a WebDriverManger instance, their capabilities can be tuned using different methods. The following table summarizes the WebDriverManager API, together with the equivalent configuration key:

Method Description Equivalent configuration key
driverVersion(String) By default, WebDriverManager tries to download the proper version of a given driver. A concrete version can be specified using this method. wdm.chromeDriverVersion, wdm.operaDriverVersion, wdm.internetExplorerDriverVersion, wdm.edgeDriverVersion, wdm.phantomjsDriverVersion, wdm.geckoDriverVersion, wdm.chromiumDriverVersion
browserVersion(String) Alternatively to the driver version, the major version of the browser can be specified using this method. wdm.chromeVersion, wdm.operaVersion, wdm.edgeVersion, wdm.firefoxVersion, wdm.chromiumVersion
cachePath(String) Folder in which drivers are stored (WedDriverManager cache). wdm.cachePath
resolutionCachePath(String) Folder in which the resolution cache file is stored (by default, in the same folder than the driver cache). wdm.resolutionCachePath
forceDownload() By default, WebDriverManager finds out the latest version of the driver, and then it uses the cached version if exists. This option forces to download again the driver even if it has been previously cached. wdm.forceDownload=true
useBetaVersions() By default, WebDriverManager skip beta versions. With this method, WebDriverManager will download also beta versions. wdm.useBetaVersions=true
architecture(Architecture) By default, WebDriverManager would try to use the proper driver for the platform running the test case (i.e. 32-bit or 64-bit). This behavior can be changed by forcing a given architecture: 32-bits (Architecture.x32) or 64-bits (Architecture.x64); wdm.architecture
arch32() Force to use the 32-bit version of a given driver. wdm.architecture=32
arch64() Force to use the 64-bit version of a given driver. wdm.architecture=64
operatingSystem(OperatingSystem) By default, WebDriverManager downloads the driver for the same operating systems than the machine running the test. This can be changed using this method (accepted values: WIN, LINUX, MAC). wdm.os=WIN, wdm.os=LINUX, wdm.os=MAC
win() Force to use driver for Windows. wdm.os=WIN
linux() Force to use driver for Linux. wdm.os=LINUX
mac() Force to use driver for Mac OS. wdm.os=MAC
driverRepositoryUrl(URL) This method allows to change the repository URL in which the drivers are hosted (see next section for default values). wdm.chromeDriverUrl, wdm.operaDriverUrl, wdm.internetExplorerDriverUrl, wdm.edgeDriverUrl, wdm.phantomjsDriverUrl, wdm.geckoDriverUrl
useMirror() The npm.taobao.org site is a mirror which hosts different software assets. Among them, it hosts chromedriver, geckodriver, operadriver, and phantomjs driver. Therefore, this method can be used for Chrome, Firefox, Opera, and PhantomJS to force to use the taobao.org mirror. wdm.useMirror=true
proxy(String) Use a HTTP proxy for the Internet connection using the following notation: my.http.proxy:1234 or username:[email protected]:1234. This can be also configured using the environment variable environment variable HTTPS_PROXY. wdm.proxy
proxyUser(String) Specify a username for HTTP proxy. This can be also configured using the environment variable environment variable HTTPS_PROXY_USER. wdm.proxyUser
proxyPass(String) Specify a password for HTTP proxy. This can be also configured using the environment variable environment variable HTTPS_PROXY_PASS. wdm.proxyPass
ignoreVersions(String...) Ignore some versions to be downloaded. wdm.ignoreVersions
gitHubTokenName(String) Token name for authenticated requests (see Known issues). wdm.gitHubTokenName
gitHubTokenSecret(String) Secret for authenticated requests (see Known issues). wdm.gitHubTokenSecret
localRepositoryUser(String) Specify a username for local repository. wdm.proxyUser
localRepositoryPassword(String) Specify a password for local repository. wdm.proxyPass
timeout(int) Timeout (in seconds) to connect and download drivers from online repositories wdm.timeout
properties(String) Properties file for configuration values (by default webdrivermanager.properties). wdm.properties
avoidExport() Avoid exporting JVM properties with the path of drivers (i.e. webdriver.chrome.driver, webdriver.gecko.driver, etc). Only recommended for interactive mode. wdm.avoidExport
avoidOutputTree() Avoid create tree structure for downloaded drivers (e.g. webdriver/chromedriver/linux64/2.37/ for chromedriver). Used by default in interactive mode. wdm.avoidOutputTree
avoidFallback() If some problem is detected while resolving a driver, a fallback mechanism is used by default (i.e. use the latest version from cache as driver). To method should be used to deactivate this fallback mechanism. wdm.avoidFallback
avoidBrowserDetection() Avoid checking the version of the installed browser (e.g. Chrome, Firefox) to find out the proper version of the required driver (e.g. chromedriver, geckodriver). Only recommended for WebDriverManager as Java dependency mode. wdm.avoidBrowserDetection
avoidReadReleaseFromRepository() Avoid checking the repository (e.g. chromedriver-latest, msedgedriver-latest) to find out the version of the required driver. wdm.avoidReadReleaseFromRepository
browserPath() As of WebDriverManager 3.0.0, to find the versions of browsers, a command is executed on the shell (e.g. google-chrome --version in Linux). The full path of the browser including the binary name (e.g. /usr/bin/google-chrome-beta) can be configured using this configuration key wdm.browserPath
ttl(int) As of WebDriverManager 3.1.0, resolved versions of drivers are stored in the resolution cache. These values has a expiration time based on this Time To Live (TTL) value, measured in seconds. By default this value is 86400 (i.e. 1 day). wdm.ttl
ttlBrowsers(int) As of WebDriverManager 4.1.0, resolved versions of browsers are stored in the resolution cache. These values has a expiration time based on this Time To Live (TTL) value, measured in seconds. By default this value is 3600 (i.e. 1 hour). wdm.ttlForBrowsers
setVersionsPropertiesUrl(URL) URL of the online version.properties file, used if the relationship between browser and driver is unknown in the local version of that file. By default this value targets to the master branch of GitHub. wdm.versionsPropertiesUrl
useLocalVersionsPropertiesFirst() As of WebDriverManager 3.7.1, the online version.properties file is read to check the latest relationship browser-driver. If the local version.properties want to be used instead, this method should be invoked wdm.versionsPropertiesOnlineFirst
clearResolutionCache() This methods allows to remove the resolution cache (browser and driver versions previously resolved). wdm.clearResolutionCache
clearDriverCache() This methods allows to remove the driver cache (driver previously resolved). By default, the resolution cache is located in the same folder that the driver, and therefore, it will be also cleared when calling this method. wdm.clearDriverCache

The following table contains some examples:

Example Description
WebDriverManager.chromedriver().driverVersion("81.0.4044.138").setup(); Force to use version 81.0.4044.138 of chromedriver
WebDriverManager.firefoxdriver().browserVersion("75").setup(); Force to use proper version of geckodriver for Firefox 75
WebDriverManager.operadriver().proxy("server:port").setup(); Using proxy server:port to resolve the proper version of operadriver
WebDriverManager.edgedriver().operatingSystem(OperatingSystem.MAC).setup(); Force to download msedgedriver for Mac OS

Additional methods are exposed by WebDriverManager, namely:

  • getDriverVersions(): This method allows to find out the list of available driver versions.
  • getDriverManagerType(): This methods allows to get the driver manager type (as enum) of a given manager.
  • getDownloadedDriverPath(): This method allows to find out the path of the latest resolved driver.
  • getDownloadedDriverVersion(): This method allows to find out the version of the latest resolved driver.

Configuration

Configuration parameters for WebDriverManager are set in the webdrivermanager.properties file:

wdm.cachePath=~/.cache/selenium
wdm.forceDownload=false
wdm.useMirror=false
wdm.useBetaVersions=false
wdm.avoidExport=false
wdm.avoidOutputTree=false
wdm.avoidBrowserDetection=false
wdm.avoidAutoReset=false
wdm.avoidResolutionCache=false
wdm.avoidFallback=false
wdm.avoidReadReleaseFromRepository=false
wdm.timeout=30
wdm.serverPort=4041
wdm.resolutionCache=resolution.properties
wdm.ttl=86400
wdm.ttlForBrowsers=3600

wdm.chromeDriverUrl=https://chromedriver.storage.googleapis.com/
wdm.chromeDriverMirrorUrl=http://npm.taobao.org/mirrors/chromedriver/
wdm.chromeDriverExport=webdriver.chrome.driver
wdm.chromeDownloadUrlPattern=https://chromedriver.storage.googleapis.com/%s/chromedriver_%s%s.zip

wdm.geckoDriverUrl=https://api.github.com/repos/mozilla/geckodriver/releases
wdm.geckoDriverMirrorUrl=http://npm.taobao.org/mirrors/geckodriver
wdm.geckoDriverExport=webdriver.gecko.driver

wdm.operaDriverUrl=https://api.github.com/repos/operasoftware/operachromiumdriver/releases
wdm.operaDriverMirrorUrl=http://npm.taobao.org/mirrors/operadriver
wdm.operaDriverExport=webdriver.opera.driver

wdm.edgeDriverUrl=https://msedgedriver.azureedge.net/
wdm.edgeDriverExport=webdriver.edge.driver
wdm.edgeDownloadUrlPattern=https://msedgewebdriverstorage.blob.core.windows.net/edgewebdriver/%s/edgedriver_%s%s.zip

wdm.internetExplorerDriverUrl=https://selenium-release.storage.googleapis.com/
wdm.internetExplorerDriverExport=webdriver.ie.driver

wdm.phantomjsDriverUrl=https://bitbucket.org/api/2.0/repositories/ariya/phantomjs/downloads
wdm.phantomjsDriverMirrorUrl=http://npm.taobao.org/mirrors/phantomjs
wdm.phantomjsDriverExport=phantomjs.binary.path

wdm.seleniumServerStandaloneUrl=https://selenium-release.storage.googleapis.com/

wdm.chromiumDriverSnapPath=/snap/bin/chromium.chromedriver

wdm.versionsPropertiesOnlineFirst=true
wdm.versionsPropertiesUrl=https://raw.githubusercontent.com/bonigarcia/webdrivermanager/master/src/main/resources/versions.properties

For instance, the variable wdm.cachePath is the default folder in which the drivers are stored. By default the path of the Maven local repository is used. This property can be overwritten by Java system properties, for example:

System.setProperty("wdm.cachePath", "/my/custom/path/to/drivers");

... or by command line, for example:

-Dwdm.cachePath=/my/custom/path/to/drivers

By default, WebDriverManager tries to download the proper version of the driver for the installed browsers. Nevertheless, concrete driver versions can be forced by changing the value of the variables wdm.chromeDriverVersion, wdm.operaDriverVersion, wdm.internetExplorerDriverVersion, or wdm.edgeDriverVersion to a concrete version. For instance:

-Dwdm.chromeDriverVersion=81.0.4044.138
-Dwdm.geckoDriverVersion=0.26.0
-Dwdm.edgeDriverVersion=81.0.410.0
-Dwdm.operaDriverVersion=81.0.4044.113

The value of these properties can be also overridden by means of environmental variables. The name of these variables result from putting the name in uppercase and replacing the symbol . by _. For example, the property wdm.cachePath can be overridden by the environment variable WDM_CACHEPATH.

Moreover, configuration values can be customized from Java code. The configuration object is unique per driver manager (i.e. WebDriverManager.chromedriver(), WebDriverManager.firefoxdriver(), etc.) and is accessed using the method config(). The configuration parameters can be reset to default values using the method reset(). For example:

WebDriverManager.chromedriver().config().setProperties("/path/to/my-wdm.properties");
WebDriverManager.operadriver().config().setForceDownload(true);
WebDriverManager.chromedriver().config().reset();

Finally, if a single configuration object needs to be specified for all the driver managers, it can be done using the static method globalConfig(). This global configuration is reset as usual using the reset() method. For example:

WebDriverManager.globalConfig().setCachePath("/path/to/my-wdm-cache");
WebDriverManager.globalConfig().reset();

WebDriverManager CLI

As of version 2.2.0, WebDriverManager can used interactively from the Command Line Interface (CLI), i.e. the shell, to resolve and download drivers for the supported browsers. There are two ways of using this feature:

  • Directly from the source code, using Maven. The command to be used is mvn exec:java -Dexec.args="browserName". For instance:
> mvn exec:java -Dexec.args="chrome"
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building WebDriverManager 4.3.1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- exec-maven-plugin:1.6.0:java (default-cli) @ webdrivermanager ---
[INFO] Using WebDriverManager to resolve chrome
[DEBUG] Running command on the shell: [google-chrome, --version]
[DEBUG] Result: Google Chrome 81.0.4044.138
[INFO] Using chromedriver 81.0.4044.138 (resolved driver for Chrome 81)
[INFO] Reading https://chromedriver.storage.googleapis.com/ to seek chromedriver
[DEBUG] Driver to be downloaded chromedriver 81.0.4044.138
[INFO] Downloading https://chromedriver.storage.googleapis.com/81.0.4044.138/chromedriver_linux64.zip
[INFO] Extracting driver from compressed file chromedriver_linux64.zip
[INFO] Driver location: /home/boni/dev/webdrivermanager/chromedriver
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  3.595 s
[INFO] Finished at: 2020-05-12T16:11:13+02:00
[INFO] ------------------------------------------------------------------------
  • Using WebDriverManager as a fat-jar (i.e. WebDriverManager with all its dependencies in a single executable JAR file). This JAR file can downloaded from here and also it can be created using the command mvn compile assembly:single from the source code. Once you get the fat-jar, you simply need to use the command java -jar webdrivermanager-4.3.1-fat.jar browserName, for instance:
> java -jar webdrivermanager-4.3.1-fat.jar chrome
[INFO] Using WebDriverManager to resolve chrome
[DEBUG] Running command on the shell: [google-chrome, --version]
[DEBUG] Result: Google Chrome 81.0.4044.138
[INFO] Using chromedriver 81.0.4044.138 (resolved driver for Chrome 81)
[INFO] Reading https://chromedriver.storage.googleapis.com/ to seek chromedriver
[DEBUG] Driver to be downloaded chromedriver 81.0.4044.138
[INFO] Downloading https://chromedriver.storage.googleapis.com/81.0.4044.138/chromedriver_linux64.zip
[INFO] Extracting driver from compressed file chromedriver_linux64.zip
[INFO] Driver location: /home/boni/Downloads/chromedriver

WebDriverManager Server

As of version 3.0.0, WebDriverManager can used as a server. To start this mode, the shell is used. Once again, two options are allowed:

  • Directly from the source code and Maven. The command to be used is mvn exec:java -Dexec.args="server <port>". If the second argument is not specified, the default port will be used (4041):
$ mvn exec:java -Dexec.args="server"
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building WebDriverManager 4.3.1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- exec-maven-plugin:1.6.0:java (default-cli) @ webdrivermanager ---
[INFO] WebDriverManager server listening on port 4041
  • Using WebDriverManager as a fat-jar. For instance:
> java -jar webdrivermanager-4.3.1-fat.jar server
[INFO] WebDriverManager server listening on port 4041

When the WebDriverManager is up and running, a REST-like API using HTTP request can be done to resolve drivers (chromedriver, geckodriver, etc.). For instance, supposing that WebDriverManager is running the local host and in the default port:

These requests use HTTP GET and can be done using a normal browser. The driver is automatically downloaded by the browser since it is sent as an attachment in the HTTP response.

In addition, configuration parameters can be specified in the URL using query arguments. The name of these arguments are identical to the parameters in the webdrivermanager.properties file but skipping the prefix wdm. (see configuration section). For instance:

Example Description
http://localhost:4041/chromedriver?chromeVersion=83 Downloads the proper driver (chromedriver) for Chrome 83
http://localhost:4041/firefoxdriver?geckoDriverVersion=0.26.0 Downloads the version 0.26.0 of geckodriver
http://localhost:4041/operadriver?os=WIN&forceDownload=true Force not to use the cache version of operadriver for Windows

Finally, requests to WebDriverManager server can be done interactively using tools such as curl, as follows:

curl -O -J http://localhost:4041/chromedriver
curl -O -J "http://localhost:4041/chromedriver?chromeVersion=83"

WebDriverManager Agent

As of version 4.0.0, WebDriverManager can be used as Java Agent. To configure that, we need to specify the the path of the WebDriverManager fat-jar using the JVM flag -javaagent:/path/to/webdrivermanager.jar. Alternatively, it can be done using Maven (see a complete project example here).

Using this approach, Selenium WebDriver tests can drop the driver setup for chromedriver, geckodriver, etc. For example:

public class ChromeTest {

    private WebDriver driver;


    @Before
    public void setupTest() {
        driver = new ChromeDriver();
    }

    @After
    public void teardown() {
        if (driver != null) {
            driver.quit();
        }
    }

    @Test
    public void test() {
        // Test logic
    }

}
public class FirefoxTest {

    private WebDriver driver;

    @Before
    public void setupTest() {
        driver = new FirefoxDriver();
    }

    @After
    public void teardown() {
        if (driver != null) {
            driver.quit();
        }
    }

    @Test
    public void test() {
        // Test logic
    }

}

The WebDriverManager Agent will check the objects being created in the JVM. Just before Selenium WebDriver objects are instantiated in the tests (org.openqa.selenium.chrome.ChromeDriver, org.openqa.selenium.firefox.FirefoxDriver, org.openqa.selenium.opera.OperaDriver, org.openqa.selenium.edge.EdgeDriver, org.openqa.selenium.phantomjs.PhantomJSDriver, or org.openqa.selenium.ie.InternetExplorerDriver), the proper WebDriverManager setup call is executed to manage the required driver (chromedriver, geckodriver, msedgedriver, etc).

$ mvn test
...
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running io.github.bonigarcia.wdm.agent.test.ChromeTest
2020-05-12 15:38:49 [main] DEBUG io.github.bonigarcia.wdm.WdmAgent.transform(86) -- WebDriverManager Agent is going to resolve the driver for Chrome
2020-05-12 15:38:49 [main] DEBUG i.g.b.wdm.cache.ResolutionCache.checkKeyInResolutionCache(183) -- Resolution chrome=81 in cache (valid until 15:23:29 13/05/2020 CEST)
2020-05-12 15:38:49 [main] INFO  i.g.bonigarcia.wdm.WebDriverManager.resolveDriverVersion(571) -- Using chromedriver 81.0.4044.138 (since Chrome 81 is installed in your machine)
2020-05-12 15:38:49 [main] DEBUG i.g.bonigarcia.wdm.WebDriverManager.manage(520) -- Driver chromedriver 81.0.4044.138 found in cache
2020-05-12 15:38:49 [main] INFO  i.g.bonigarcia.wdm.WebDriverManager.exportDriver(615) -- Exporting webdriver.chrome.driver as /home/boni/.cache/selenium/webdriver/chromedriver/linux64/81.0.4044.138/chromedriver
Starting ChromeDriver 81.0.4044.138 (8c6c7ba89cc9453625af54f11fd83179e23450fa-refs/branch-heads/4044@{#999}) on port 31286
2020-05-12 15:38:50 [main] DEBUG i.g.b.wdm.agent.test.ChromeTest.test(54) -- The title of https://bonigarcia.github.io/selenium-jupiter/ is Selenium-Jupiter: JUnit 5 extension for Selenium
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.814 s - in io.github.bonigarcia.wdm.agent.test.ChromeTest
[INFO] Running io.github.bonigarcia.wdm.agent.test.FirefoxTest
2020-05-12 15:46:04 [main] DEBUG io.github.bonigarcia.wdm.WdmAgent.transform(86) -- WebDriverManager Agent is going to resolve the driver for Firefox
2020-05-12 15:46:04 [main] DEBUG i.g.b.wdm.cache.ResolutionCache.checkKeyInResolutionCache(183) -- Resolution firefox=76 in cache (valid until 15:45:41 13/05/2020 CEST)
2020-05-12 15:46:04 [main] INFO  i.g.bonigarcia.wdm.WebDriverManager.resolveDriverVersion(571) -- Using geckodriver 0.26.0 (since Firefox 76 is installed in your machine)
2020-05-12 15:46:04 [main] DEBUG i.g.bonigarcia.wdm.WebDriverManager.manage(520) -- Driver geckodriver 0.26.0 found in cache
2020-05-12 15:46:04 [main] INFO  i.g.bonigarcia.wdm.WebDriverManager.exportDriver(615) -- Exporting webdriver.gecko.driver as /home/boni/.cache/selenium/webdriver/geckodriver/linux64/0.26.0/geckodriver
2020-05-12 15:46:07 [main] DEBUG i.g.b.wdm.agent.test.FirefoxTest.test(54) -- The title of https://bonigarcia.github.io/selenium-jupiter/ is Selenium-Jupiter: JUnit 5 extension for Selenium
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 6.163 s - in io.github.bonigarcia.wdm.agent.test.FirefoxTest
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  10.017 s
[INFO] Finished at: 2020-05-12T15:46:10+02:00
[INFO] ------------------------------------------------------------------------

WebDriverManager Docker container

As of version 4.0.0, WebDriverManager can be used as a Docker container to execute the Server and CLI modes. To execute WebDriverManager Server in Docker, you simply need to run the following command:

docker run -p 4041:4041 bonigarcia/webdrivermanager:4.3.1

To execute WebDriverManager CLI in Docker, you need to specify the type of browser to be resolved as environmental variable (BROWSER). The rest of WebDriverManager configuration parameters can be passed to the Docker container using env variables using the usual -e option in Docker. For example, in Linux:

docker run --rm -e BROWSER=chrome -e WDM_CHROMEVERSION=84 -e WDM_OS=LINUX -v ${PWD}:/wdm bonigarcia/webdrivermanager:4.3.1

... or Mac:

docker run --rm -e BROWSER=chrome -e WDM_CHROMEVERSION=84 -e WDM_OS=MAC -v ${PWD}:/wdm bonigarcia/webdrivermanager:4.3.1

... or Windows (if WSL2 is installed in Windows, you can use ${PWD} instead of %cd% for the volume setup):

docker run --rm -e BROWSER=chrome -e WDM_CHROMEVERSION=84 -e WDM_OS=WIN -v %cd%:/wdm bonigarcia/webdrivermanager:4.3.1

Known issues

HTTP response code 403

Some of the drivers (e.g. geckodriver or operadriver) are hosted on GitHub. When several consecutive requests are made by WebDriverManager, GitHub servers return an HTTP 403 error response as follows:

Caused by: java.io.IOException: Server returned HTTP response code: 403 for URL: https://api.github.com/repos/operasoftware/operachromiumdriver/releases
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1840)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1441)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)
    at io.github.bonigarcia.wdm.BrowserManager.openGitHubConnection(BrowserManager.java:463)
    at io.github.bonigarcia.wdm.OperaDriverManager.getDrivers(OperaDriverManager.java:55)
    at io.github.bonigarcia.wdm.BrowserManager.manage(BrowserManager.java:168)
Caused by: java.io.IOException: Server returned HTTP response code: 403 for URL: https://api.github.com/repos/mozilla/geckodriver/releases
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1840)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1441)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)
    at io.github.bonigarcia.wdm.FirefoxDriverManager.getDrivers(FirefoxDriverManager.java:61)
    at io.github.bonigarcia.wdm.BrowserManager.manage(BrowserManager.java:163)

To avoid this problem, authenticated requests should be done. The procedure is the following:

  1. Create a token/secret pair in your GitHub account.
  2. Tell WebDriverManager the value of this pair token/secret. To do that you should use the configuration keys wdm.gitHubTokenName and wdm.gitHubTokenSecret. You can pass them as command line Java parameters as follows:
-Dwdm.gitHubTokenName=<your-token-name>
-Dwdm.gitHubTokenSecret=<your-token-secret>

... or as environment variables (e.g. in Travis CI) as follows:

WDM_GITHUBTOKENNAME=<your-token-name>
WDM_GITHUBTOKENSECRET=<your-token-secret>

TravisCI fork builds

If you have a fork and want to build using the same travis.yml you have to add some enviroment variables to your TravisCI instance configuration:

If you want disable the SonarSource validation add a variable TRAVIS_PULL_REQUEST with value true.

Tons of org.apache.http DEBUG log

WebDriverManager uses Apache HTTP Client to download drivers from online repositories. Internally, Apache HTTP client writes a lot of logging information using the DEBUG level of org.apache.http classes. To reduce this amount of logs, the level of this logger might be reduced. For instance, in the case of Logback, the log configuration file should include the following:

<configuration>
    <logger name="org.apache.hc" level="WARN" />
</configuration>

You can find further information about others logging implementations in the Apache HTTP Client logging practices page.

Help

If you have questions on how to use WebDriverManager properly with a special configuration or suchlike, please consider asking a question on Stack Overflow and tag it with webdrivermanager-java.

Backers

Thank you to all our backers! [Become a backer]

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]

About

WebDriverManager (Copyright © 2015-2021) is a project created and maintained by Boni Garcia and licensed under the terms of the Apache 2.0 License.

Comments
  • session not created: This version of ChromeDriver only supports Chrome version 75

    session not created: This version of ChromeDriver only supports Chrome version 75

    I started getting this error sometime recently in my own code base, but I also just checked out master (d1e626bb180b012e5c2ec88da9c88e1286114c09) and I get the same thing when running the io.github.bonigarcia.wdm.test.ChromeTest test from this repository.

    As you can see from the log, the Downloader gets chrome 75.0.3770.8 and sets up my environment to use that downloaded driver, but I still get the error session not created: This version of ChromeDriver only supports Chrome version 75.

    Am I missing something?

    2019-05-16 08:42:01 [main] DEBUG io.github.bonigarcia.wdm.Shell.runAndWaitNoLog(70) -- There was a problem executing command <google-chrome --version> on the shell: Cannot run program "google-chrome" (in directory "."): error=2, No such file or directory
    2019-05-16 08:42:01 [main] DEBUG i.g.bonigarcia.wdm.WebDriverManager.detectDriverVersionFromBrowser(573) -- The proper chromedriver version for your Google Chrome is unknown ... trying with the latest
    2019-05-16 08:42:01 [main] INFO  i.g.bonigarcia.wdm.WebDriverManager.getDriversFromXml(1006) -- Reading https://chromedriver.storage.googleapis.com/ to seek chromedriver
    2019-05-16 08:42:01 [main] INFO  i.g.bonigarcia.wdm.WebDriverManager.checkLatest(909) -- Latest version of chromedriver is 75.0.3770.8
    2019-05-16 08:42:01 [main] INFO  io.github.bonigarcia.wdm.Downloader.downloadAndExtract(128) -- Downloading https://chromedriver.storage.googleapis.com/75.0.3770.8/chromedriver_linux64.zip
    2019-05-16 08:42:02 [main] INFO  io.github.bonigarcia.wdm.Downloader.extract(183) -- Extracting binary from compressed file chromedriver_linux64.zip
    2019-05-16 08:42:02 [main] INFO  i.g.bonigarcia.wdm.WebDriverManager.exportDriver(1042) -- Exporting webdriver.chrome.driver as /home/sherzberg/.m2/repository/webdriver/chromedriver/linux64/75.0.3770.8/chromedriver
    Starting ChromeDriver 75.0.3770.8 (681f24ea911fe754973dda2fdc6d2a2e159dd300-refs/branch-heads/3770@{#40}) on port 28781
    Only local connections are allowed.
    Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
    
    org.openqa.selenium.SessionNotCreatedException: session not created: This version of ChromeDriver only supports Chrome version 75
    Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
    System info: host: 'tiblets', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.14.113-1-MANJARO', java.version: '1.8.0_212'
    Driver info: driver.version: ChromeDriver
    remote stacktrace: #0 0x56542eb82299 <unknown>
    
    
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    	at org.openqa.selenium.remote.W3CHandshakeResponse.lambda$errorHandler$0(W3CHandshakeResponse.java:62)
    	at org.openqa.selenium.remote.HandshakeResponse.lambda$getResponseFunction$0(HandshakeResponse.java:30)
    	at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$0(ProtocolHandshake.java:126)
    	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
    	at java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:958)
    	at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)
    	at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:499)
    	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:486)
    	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
    	at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152)
    	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
    	at java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:464)
    	at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:128)
    	at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:74)
    	at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:136)
    	at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
    	at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
    	at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:213)
    	at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:131)
    	at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:181)
    	at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:168)
    	at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:123)
    	at io.github.bonigarcia.wdm.test.ChromeTest.setupTest(ChromeTest.java:41)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:498)
    	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
    	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
    	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
    	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
    	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
    	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
    	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
    	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
    	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
    	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
    	at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
    	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
    	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
    
    
    Process finished with exit code 255
    
    question 
    opened by sherzberg 39
  • intermittently fails to download driver when running in parallel

    intermittently fails to download driver when running in parallel

    Hi, I've got a set of tests that run in parallel, in 8 browsers at the same time. It uses TestNG and Surefire to do the parallel tests. They run on an ubuntu VM so each time a test run starts they need to download the chromedriver binaries but intermittently they just report that the binary is not found.

    The logs I get are: java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.chrome.driver system property; for more information, see https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver. The latest version can be downloaded from http://chromedriver.storage.googleapis.com/index.html

    bug 
    opened by damonsmith 31
  • Chrome 74. Global Config via code. README is out of date.

    Chrome 74. Global Config via code. README is out of date.

    Chrome 74 is a thing now. The webdrivermanger downloads chrome 74 but tries to run chrome 73 causing failure.

    I was using version 3.0.0 and using WebDriverManager.config() to globally set the target path for all drivers to put the binaries in. However in the newer versions it doesn't seem to work. I would rather not set a target path for each browser individually so I looked for how to set global config but found this in the README:

    Moreover, as of WebDriverManager 2.2.x, configuration value can be customized using a configuration manager. This manager can be accessed using WebDriverManager.config(). For example:
    

    which doesn't work. How can I globally setTargetPath for all drivers.

    enhancement 
    opened by evanliferock 26
  • Issue with Latest Chrome Driver Version 74?

    Issue with Latest Chrome Driver Version 74?

    Currently whenever the tests are executing on windows with latest chrome driver 74.x version being pulled down, we are getting the following error. Tested on machines running windows 7, windows server 2012 among others. Used the stop gap work around to force use 2.46 in the mean time.

    So should the 74.x be made the default here ?

    org.openqa.selenium.SessionNotCreatedException: session not created: This version of ChromeDriver only supports Chrome version 74 23:04:25 (Driver info: chromedriver=74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729@{#29}),platform=Windows NT 6.3.9600 x86_64) (WARNING: The server did not provide any stacktrace information)

    duplicate 
    opened by bbarman4u 25
  • Timed out receiving message from renderer: 0.100

    Timed out receiving message from renderer: 0.100

    In LOG i see this problems

    Starting ChromeDriver 80.0.3987.106 (f68069574609230cf9b635cd784cfb1bf81bb53a-refs/branch-heads/3987@{#882}) on port 13864 Only local connections are allowed. Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code. Feb 25, 2020 5:00:45 PM org.openqa.selenium.remote.ProtocolHandshake createSession INFO: Detected dialect: W3C [1582678866.122][SEVERE]: Timed out receiving message from renderer: 0.100 [1582678866.324][SEVERE]: Timed out receiving message from renderer: 0.100 [1582678866.514][SEVERE]: Timed out receiving message from renderer: 0.100 [1582678866.619][SEVERE]: Timed out receiving message from renderer: 0.100 [1582678866.726][SEVERE]: Timed out receiving message from renderer: 0.100

    Browser: Run on Google Chrome is up to date Version 80.0.3987.122 (Official Build) (64-bit)

    OS: Windows 10 (64-bit)

    POM:

    WebDriverManager version 3.7.1

    	<dependency>
    		<groupId>io.github.bonigarcia</groupId>
    		<artifactId>webdrivermanager</artifactId>
    		<version>3.7.1</version>
    	</dependency>
    

    In JAVA code

    case "Chrome": WebDriverManager.chromedriver().setup();

    what the problems ?

    Thanks

    question 
    opened by etuviana 24
  • Chrome version is updated to 83 and tests are failing in it..

    Chrome version is updated to 83 and tests are failing in it..

    Description of the problem: Tests are failing in the updated chrome version with an error message - org.openqa.selenium.SessionNotCreatedException: session not created: This version of ChromeDriver only supports Chrome version 81

    Browser and version: Chrome - 83

    Operating system: Mac OSX

    WebDriverManager version: Latest version

    question 
    opened by Aman-RateHub 22
  • There was an error managing chromedriver  (Connection reset)

    There was an error managing chromedriver (Connection reset)

    Hi Boni I appraciaete for your repository.İt makes everything easier. My question is when I try to setup chrome driver instance with 'ChromeDriverManager.getInstance().setup()' line, I get the exception below;

    [main] ERROR io.github.bonigarcia.wdm.WebDriverManager - There was an error managing chromedriver (Connection reset) java.net.SocketException: Connection reset at java.net.SocketInputStream.read(SocketInputStream.java:210) at java.net.SocketInputStream.read(SocketInputStream.java:141) at sun.security.ssl.InputRecord.readFully(InputRecord.java:465) at sun.security.ssl.InputRecord.read(InputRecord.java:503) at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:983) at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1385) at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1413) at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1397) at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:396) at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:355) at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142) at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:373) at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:381) at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:237) at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:185) at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89) at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:111) at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:108) at io.github.bonigarcia.wdm.HttpClient.execute(HttpClient.java:166) at io.github.bonigarcia.wdm.WebDriverManager.getDriversFromXml(WebDriverManager.java:786) at io.github.bonigarcia.wdm.ChromeDriverManager.getDrivers(ChromeDriverManager.java:54) at io.github.bonigarcia.wdm.WebDriverManager.filterCandidateUrls(WebDriverManager.java:487) at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:439) at io.github.bonigarcia.wdm.WebDriverManager.handleException(WebDriverManager.java:468) at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:454) at io.github.bonigarcia.wdm.WebDriverManager.setup(WebDriverManager.java:215) at com.dmall.uat.models.browsertypes.Chrome.initInLocal(Chrome.java:39) at com.dmall.uat.models.browser.Browser.open(Browser.java:129) at com.dmall.uat.models.browser.Browser.openThe(Browser.java:60) at com.dmall.uat.models.users.Visitor.open(Visitor.java:117) at com.dmall.uat.selleroffice.user.SellerLogin.loginSellerOffice(SellerLogin.java:34) at com.dmall.uat.sellerapi.EInvoiceServiceTest.shouldGenerateEInvoiceViaNotCombinedShippingThenDisplayFromWeb(EInvoiceServiceTest.java:127) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55) at com.dmall.uat.test.StopFixtures$1.evaluate(StopFixtures.java:32) at com.dmall.uat.test.TestContextInitializer$1.evaluate(TestContextInitializer.java:38) at org.junit.rules.RunRules.evaluate(RunRules.java:20) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68) at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)

    io.github.bonigarcia.wdm.WebDriverManagerException: java.net.SocketException: Connection reset

    at io.github.bonigarcia.wdm.WebDriverManager.handleException(WebDriverManager.java:471)
    at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:454)
    at io.github.bonigarcia.wdm.WebDriverManager.handleException(WebDriverManager.java:468)
    at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:454)
    at io.github.bonigarcia.wdm.WebDriverManager.setup(WebDriverManager.java:215)
    at com.dmall.uat.models.browsertypes.Chrome.initInLocal(Chrome.java:39)
    at com.dmall.uat.models.browser.Browser.open(Browser.java:129)
    at com.dmall.uat.models.browser.Browser.openThe(Browser.java:60)
    at com.dmall.uat.models.users.Visitor.open(Visitor.java:117)
    at com.dmall.uat.selleroffice.user.SellerLogin.loginSellerOffice(SellerLogin.java:34)
    at com.dmall.uat.sellerapi.EInvoiceServiceTest.shouldGenerateEInvoiceViaNotCombinedShippingThenDisplayFromWeb(EInvoiceServiceTest.java:127)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
    at com.dmall.uat.test.StopFixtures$1.evaluate(StopFixtures.java:32)
    at com.dmall.uat.test.TestContextInitializer$1.evaluate(TestContextInitializer.java:38)
    at org.junit.rules.RunRules.evaluate(RunRules.java:20)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
    at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
    at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
    at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
    at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
    

    Caused by: java.net.SocketException: Connection reset at java.net.SocketInputStream.read(SocketInputStream.java:210) at java.net.SocketInputStream.read(SocketInputStream.java:141) at sun.security.ssl.InputRecord.readFully(InputRecord.java:465) at sun.security.ssl.InputRecord.read(InputRecord.java:503) at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:983) at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1385) at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1413) at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1397) at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:396) at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:355) at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142) at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:373) at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:381) at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:237) at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:185) at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89) at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:111) at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:108) at io.github.bonigarcia.wdm.HttpClient.execute(HttpClient.java:166) at io.github.bonigarcia.wdm.WebDriverManager.getDriversFromXml(WebDriverManager.java:786) at io.github.bonigarcia.wdm.ChromeDriverManager.getDrivers(ChromeDriverManager.java:54) at io.github.bonigarcia.wdm.WebDriverManager.filterCandidateUrls(WebDriverManager.java:487) at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:439) ... 35 more

    Process finished with exit code 255

    question 
    opened by slymanAktas 22
  • No proper candidate URL to download chromedriver 84.0.4147.30

    No proper candidate URL to download chromedriver 84.0.4147.30

    Description of the problem: We started getting such an error after updating chrome to the latest version.

    Browser and version: Chrome Browser 84.0.4147.105

    Operating system: Windows 10 64 Bit

    WebDriverManager version: 4.1.0

    WebDriverManager use: public WebDriver getDriver(String driverType) throws IOException, ParseException { String headless = applicationProperties.getProperties("headless"); if (driverType.toLowerCase().equals("chrome")) { WebDriverManager.chromedriver().setup(); if (headless.equals("true")) { ChromeOptions chromeOptions = new ChromeOptions(); chromeOptions.addArguments("--headless"); chromeOptions.addArguments("--disable-gpu"); chromeOptions.addArguments("--no-sandbox"); driver = new ChromeDriver(chromeOptions); } else { driver = new ChromeDriver(); } } else if (driverType.toLowerCase().equals("firefox")) { WebDriverManager.firefoxdriver().setup(); if (headless.equals("true")) { FirefoxOptions firefoxOptions = new FirefoxOptions(); firefoxOptions.setHeadless(true); driver = new FirefoxDriver(); } else { driver = new FirefoxDriver(); } } else { logger.error("Unsupported Browser Type"); } return driver; }

    WebDriverManager traces: **Testing started at 21:20 ... "C:\Program Files\Java\jdk1.8.0_261\bin\java.exe" -Dorg.jetbrains.run.directory=C:\otomasyonçalışmalarım\test-automation-lesson\test-automation-lesson\src\test\resources\features "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2020.1.4\lib\idea_rt.jar=55441:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2020.1.4\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\Java\jdk1.8.0_261\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_261\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_261\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_261\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_261\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_261\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_261\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_261\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_261\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_261\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_261\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_261\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_261\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_261\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.8.0_261\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_261\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_261\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_261\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_261\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_261\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_261\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_261\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_261\jre\lib\rt.jar;C:\otomasyonçalışmalarım\test-automation-lesson\test-automation-lesson\target\test-classes;C:\otomasyonçalışmalarım\test-automation-lesson\test-automation-lesson\target\classes;C:\Users\Testinium.m2\repository\org\seleniumhq\selenium\selenium-java\3.141.59\selenium-java-3.141.59.jar;C:\Users\Testinium.m2\repository\org\seleniumhq\selenium\selenium-api\3.141.59\selenium-api-3.141.59.jar;C:\Users\Testinium.m2\repository\org\seleniumhq\selenium\selenium-chrome-driver\3.141.59\selenium-chrome-driver-3.141.59.jar;C:\Users\Testinium.m2\repository\org\seleniumhq\selenium\selenium-edge-driver\3.141.59\selenium-edge-driver-3.141.59.jar;C:\Users\Testinium.m2\repository\org\seleniumhq\selenium\selenium-firefox-driver\3.141.59\selenium-firefox-driver-3.141.59.jar;C:\Users\Testinium.m2\repository\org\seleniumhq\selenium\selenium-ie-driver\3.141.59\selenium-ie-driver-3.141.59.jar;C:\Users\Testinium.m2\repository\org\seleniumhq\selenium\selenium-opera-driver\3.141.59\selenium-opera-driver-3.141.59.jar;C:\Users\Testinium.m2\repository\org\seleniumhq\selenium\selenium-remote-driver\3.141.59\selenium-remote-driver-3.141.59.jar;C:\Users\Testinium.m2\repository\org\seleniumhq\selenium\selenium-safari-driver\3.141.59\selenium-safari-driver-3.141.59.jar;C:\Users\Testinium.m2\repository\org\seleniumhq\selenium\selenium-support\3.141.59\selenium-support-3.141.59.jar;C:\Users\Testinium.m2\repository\net\bytebuddy\byte-buddy\1.8.15\byte-buddy-1.8.15.jar;C:\Users\Testinium.m2\repository\org\apache\commons\commons-exec\1.3\commons-exec-1.3.jar;C:\Users\Testinium.m2\repository\com\google\guava\guava\25.0-jre\guava-25.0-jre.jar;C:\Users\Testinium.m2\repository\com\google\code\findbugs\jsr305\1.3.9\jsr305-1.3.9.jar;C:\Users\Testinium.m2\repository\org\checkerframework\checker-compat-qual\2.0.0\checker-compat-qual-2.0.0.jar;C:\Users\Testinium.m2\repository\com\google\errorprone\error_prone_annotations\2.1.3\error_prone_annotations-2.1.3.jar;C:\Users\Testinium.m2\repository\com\google\j2objc\j2objc-annotations\1.1\j2objc-annotations-1.1.jar;C:\Users\Testinium.m2\repository\org\codehaus\mojo\animal-sniffer-annotations\1.14\animal-sniffer-annotations-1.14.jar;C:\Users\Testinium.m2\repository\com\squareup\okhttp3\okhttp\3.11.0\okhttp-3.11.0.jar;C:\Users\Testinium.m2\repository\com\squareup\okio\okio\1.14.0\okio-1.14.0.jar;C:\Users\Testinium.m2\repository\org\testng\testng\7.1.0\testng-7.1.0.jar;C:\Users\Testinium.m2\repository\com\beust\jcommander\1.72\jcommander-1.72.jar;C:\Users\Testinium.m2\repository\com\google\inject\guice\4.1.0\guice-4.1.0-no_aop.jar;C:\Users\Testinium.m2\repository\javax\inject\javax.inject\1\javax.inject-1.jar;C:\Users\Testinium.m2\repository\aopalliance\aopalliance\1.0\aopalliance-1.0.jar;C:\Users\Testinium.m2\repository\org\yaml\snakeyaml\1.21\snakeyaml-1.21.jar;C:\Users\Testinium.m2\repository\io\github\bonigarcia\webdrivermanager\4.1.0\webdrivermanager-4.1.0.jar;C:\Users\Testinium.m2\repository\org\slf4j\slf4j-api\1.7.30\slf4j-api-1.7.30.jar;C:\Users\Testinium.m2\repository\commons-io\commons-io\2.7\commons-io-2.7.jar;C:\Users\Testinium.m2\repository\com\google\code\gson\gson\2.8.6\gson-2.8.6.jar;C:\Users\Testinium.m2\repository\org\apache\commons\commons-lang3\3.10\commons-lang3-3.10.jar;C:\Users\Testinium.m2\repository\org\apache\httpcomponents\client5\httpclient5\5.0.1\httpclient5-5.0.1.jar;C:\Users\Testinium.m2\repository\org\apache\httpcomponents\core5\httpcore5\5.0.1\httpcore5-5.0.1.jar;C:\Users\Testinium.m2\repository\org\apache\httpcomponents\core5\httpcore5-h2\5.0.1\httpcore5-h2-5.0.1.jar;C:\Users\Testinium.m2\repository\commons-codec\commons-codec\1.13\commons-codec-1.13.jar;C:\Users\Testinium.m2\repository\org\rauschig\jarchivelib\1.0.0\jarchivelib-1.0.0.jar;C:\Users\Testinium.m2\repository\org\apache\commons\commons-compress\1.18\commons-compress-1.18.jar;C:\Users\Testinium.m2\repository\org\jsoup\jsoup\1.13.1\jsoup-1.13.1.jar;C:\Users\Testinium.m2\repository\io\cucumber\cucumber-java\4.8.1\cucumber-java-4.8.1.jar;C:\Users\Testinium.m2\repository\io\cucumber\cucumber-core\4.8.1\cucumber-core-4.8.1.jar;C:\Users\Testinium.m2\repository\io\cucumber\gherkin\5.1.0\gherkin-5.1.0.jar;C:\Users\Testinium.m2\repository\io\cucumber\tag-expressions\1.1.1\tag-expressions-1.1.1.jar;C:\Users\Testinium.m2\repository\io\cucumber\cucumber-expressions\7.0.2\cucumber-expressions-7.0.2.jar;C:\Users\Testinium.m2\repository\io\cucumber\datatable\1.1.14\datatable-1.1.14.jar;C:\Users\Testinium.m2\repository\io\cucumber\datatable-dependencies\1.1.14\datatable-dependencies-1.1.14.jar;C:\Users\Testinium.m2\repository\org\apiguardian\apiguardian-api\1.1.0\apiguardian-api-1.1.0.jar;C:\Users\Testinium.m2\repository\io\cucumber\cucumber-junit\4.8.1\cucumber-junit-4.8.1.jar;C:\Users\Testinium.m2\repository\junit\junit\4.12\junit-4.12.jar;C:\Users\Testinium.m2\repository\org\hamcrest\hamcrest-core\1.3\hamcrest-core-1.3.jar;C:\Users\Testinium.m2\repository\com\googlecode\json-simple\json-simple\1.1.1\json-simple-1.1.1.jar;C:\Users\Testinium.m2\repository\io\qameta\allure\allure-cucumber3-jvm\2.13.3\allure-cucumber3-jvm-2.13.3.jar;C:\Users\Testinium.m2\repository\io\qameta\allure\allure-java-commons\2.13.3\allure-java-commons-2.13.3.jar;C:\Users\Testinium.m2\repository\io\qameta\allure\allure-model\2.13.3\allure-model-2.13.3.jar;C:\Users\Testinium.m2\repository\com\fasterxml\jackson\core\jackson-databind\2.9.8\jackson-databind-2.9.8.jar;C:\Users\Testinium.m2\repository\com\fasterxml\jackson\core\jackson-annotations\2.9.0\jackson-annotations-2.9.0.jar;C:\Users\Testinium.m2\repository\com\fasterxml\jackson\core\jackson-core\2.9.8\jackson-core-2.9.8.jar;C:\Users\Testinium.m2\repository\org\apache\tika\tika-core\1.20\tika-core-1.20.jar;C:\Users\Testinium.m2\repository\org\jooq\joor-java-8\0.9.10\joor-java-8-0.9.10.jar;C:\Users\Testinium.m2\repository\io\rest-assured\rest-assured\4.3.1\rest-assured-4.3.1.jar;C:\Users\Testinium.m2\repository\org\codehaus\groovy\groovy\3.0.3\groovy-3.0.3.jar;C:\Users\Testinium.m2\repository\org\codehaus\groovy\groovy-xml\3.0.3\groovy-xml-3.0.3.jar;C:\Users\Testinium.m2\repository\org\apache\httpcomponents\httpclient\4.5.3\httpclient-4.5.3.jar;C:\Users\Testinium.m2\repository\org\apache\httpcomponents\httpcore\4.4.6\httpcore-4.4.6.jar;C:\Users\Testinium.m2\repository\commons-logging\commons-logging\1.2\commons-logging-1.2.jar;C:\Users\Testinium.m2\repository\org\apache\httpcomponents\httpmime\4.5.3\httpmime-4.5.3.jar;C:\Users\Testinium.m2\repository\org\hamcrest\hamcrest\2.1\hamcrest-2.1.jar;C:\Users\Testinium.m2\repository\org\ccil\cowan\tagsoup\tagsoup\1.2.1\tagsoup-1.2.1.jar;C:\Users\Testinium.m2\repository\io\rest-assured\json-path\4.3.1\json-path-4.3.1.jar;C:\Users\Testinium.m2\repository\org\codehaus\groovy\groovy-json\3.0.3\groovy-json-3.0.3.jar;C:\Users\Testinium.m2\repository\io\rest-assured\rest-assured-common\4.3.1\rest-assured-common-4.3.1.jar;C:\Users\Testinium.m2\repository\io\rest-assured\xml-path\4.3.1\xml-path-4.3.1.jar;C:\Users\Testinium.m2\repository\jakarta\xml\bind\jakarta.xml.bind-api\2.3.3\jakarta.xml.bind-api-2.3.3.jar;C:\Users\Testinium.m2\repository\jakarta\activation\jakarta.activation-api\1.2.2\jakarta.activation-api-1.2.2.jar;C:\Users\Testinium.m2\repository\com\sun\xml\bind\jaxb-impl\2.3.3\jaxb-impl-2.3.3.jar;C:\Users\Testinium.m2\repository\mysql\mysql-connector-java\8.0.20\mysql-connector-java-8.0.20.jar;C:\Users\Testinium.m2\repository\com\google\protobuf\protobuf-java\3.6.1\protobuf-java-3.6.1.jar;C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2020.1.4\plugins\junit\lib\junit-rt.jar;C:\Users\Testinium\AppData\Roaming\JetBrains\IdeaIC2020.1\plugins\cucumber-java\lib\cucumber-jvmFormatter.jar;C:\Users\Testinium\AppData\Roaming\JetBrains\IdeaIC2020.1\plugins\cucumber-java\lib\cucumber-jvmFormatter4.jar;C:\Users\Testinium\AppData\Roaming\JetBrains\IdeaIC2020.1\plugins\cucumber-java\lib\cucumber-jvmFormatter3.jar" io.cucumber.core.cli.Main --plugin org.jetbrains.plugins.cucumber.java.run.CucumberJvm4SMFormatter --glue steps.web C:/otomasyonçalışmalarım/test-automation-lesson/test-automation-lesson/src/test/resources/features/Easy.feature SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

    io.github.bonigarcia.wdm.config.WebDriverManagerException: io.github.bonigarcia.wdm.config.WebDriverManagerException: No proper candidate URL to download chromedriver 84.0.4147.30 at io.github.bonigarcia.wdm.WebDriverManager.handleException(WebDriverManager.java:747) at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:541) at io.github.bonigarcia.wdm.WebDriverManager.handleException(WebDriverManager.java:744) at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:541) at io.github.bonigarcia.wdm.WebDriverManager.setup(WebDriverManager.java:277) at util.DriverManager.getDriver(DriverManager.java:27) at steps.web.WebSteps.openBrowser(WebSteps.java:35) at ✽.I open "Chrome" browser(file:/C:/otomasyonçalışmalarım/test-automation-lesson/test-automation-lesson/src/test/resources/features/Easy.feature:4) Caused by: io.github.bonigarcia.wdm.config.WebDriverManagerException: No proper candidate URL to download chromedriver 84.0.4147.30 at io.github.bonigarcia.wdm.online.UrlHandler.getCandidateUrl(UrlHandler.java:284) at io.github.bonigarcia.wdm.WebDriverManager.download(WebDriverManager.java:603) at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:535) at io.github.bonigarcia.wdm.WebDriverManager.handleException(WebDriverManager.java:744) at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:541) at io.github.bonigarcia.wdm.WebDriverManager.setup(WebDriverManager.java:277) at util.DriverManager.getDriver(DriverManager.java:27) at steps.web.WebSteps.openBrowser(WebSteps.java:35) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at cucumber.runtime.Utils$1.call(Utils.java:26) at cucumber.runtime.Timeout.timeout(Timeout.java:16) at cucumber.runtime.Utils.invoke(Utils.java:20) at cucumber.runtime.java.JavaStepDefinition.execute(JavaStepDefinition.java:57) at cucumber.runner.PickleStepDefinitionMatch.runStep(PickleStepDefinitionMatch.java:50) at cucumber.runner.TestStep.executeStep(TestStep.java:65) at cucumber.runner.TestStep.run(TestStep.java:50) at cucumber.runner.PickleStepTestStep.run(PickleStepTestStep.java:43) at cucumber.runner.TestCase.run(TestCase.java:46) at cucumber.runner.Runner.runPickle(Runner.java:50) at cucumber.runtime.Runtime$1.run(Runtime.java:104) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at cucumber.runtime.Runtime$SameThreadExecutorService.execute(Runtime.java:258) at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112) at cucumber.runtime.Runtime.run(Runtime.java:101) at io.cucumber.core.cli.Main.run(Main.java:43) at io.cucumber.core.cli.Main.main(Main.java:14)**

    bug 
    opened by musanmaz 18
  • WebDriverManager.edgedriver().setup() fails with NoSuchElementException

    WebDriverManager.edgedriver().setup() fails with NoSuchElementException

    Hi,

    I am using webdrivemanager v3.4.0 and try to initialise the EdgeDriver by calling

    WebDriverManager.edgedriver().setup();
    EdgeDriver edgeDriver = new EdgeDriver();
    edgeDriver.get("http://www.google.de");
    

    this fails with

    Exception in thread "main" io.github.bonigarcia.wdm.WebDriverManagerException: java.util.NoSuchElementException
    	at io.github.bonigarcia.wdm.WebDriverManager.handleException(WebDriverManager.java:715)
    	at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:540)
    	at io.github.bonigarcia.wdm.WebDriverManager.handleException(WebDriverManager.java:712)
    	at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:540)
    	at io.github.bonigarcia.wdm.WebDriverManager.setup(WebDriverManager.java:260)
    	at de.end2end.browser.interaction.Browser.main(Browser.java:104)
    Caused by: java.util.NoSuchElementException
    	at java.base/java.util.LinkedList$ListItr.next(LinkedList.java:894)
    	at io.github.bonigarcia.wdm.EdgeDriverManager.postDownload(EdgeDriverManager.java:155)
    	at io.github.bonigarcia.wdm.Downloader.extract(Downloader.java:202)
    	at io.github.bonigarcia.wdm.Downloader.downloadAndExtract(Downloader.java:138)
    	at io.github.bonigarcia.wdm.Downloader.download(Downloader.java:81)
    	at io.github.bonigarcia.wdm.WebDriverManager.downloadCandidateUrls(WebDriverManager.java:723)
    	at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:536)
    	... 4 more
    

    when debugging this, it looks like that the candidate urls work differently.

    In io.github.bonigarcia.wdm.WebDriverManager#filterCandidateUrls, the following List<URL> is returned:

    [https://msedgecdn.azurewebsites.net/webdriver/index.html]

    This is for Release 75. This link messes up all following assumptions of downloading a driver

    Possible earlier releases like Release 17134 seems to have a correct url https://download.microsoft.com/download/F/8/A/F8AF50AB-3C3A-4BC4-8773-DC27B32988DD/MicrosoftWebDriver.exe, but I cannot use

    WebDriverManager.edgedriver().version("17134").setup();
    EdgeDriver edgeDriver = new EdgeDriver();
    edgeDriver.get("http://www.google.de");
    

    as this fails with

    Exception in thread "main" io.github.bonigarcia.wdm.WebDriverManagerException: io.github.bonigarcia.wdm.WebDriverManagerException: MicrosoftWebDriver 17134 for WIN64 not found in https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/
    	at io.github.bonigarcia.wdm.WebDriverManager.handleException(WebDriverManager.java:715)
    	at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:540)
    	at io.github.bonigarcia.wdm.WebDriverManager.handleException(WebDriverManager.java:712)
    	at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:540)
    	at io.github.bonigarcia.wdm.WebDriverManager.setup(WebDriverManager.java:260)
    	at de.end2end.browser.interaction.Browser.main(Browser.java:104)
    Caused by: io.github.bonigarcia.wdm.WebDriverManagerException: MicrosoftWebDriver 17134 for WIN64 not found in https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/
    	at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:533)
    	... 4 more
    

    Is this an issue or do I have a wrong configuration ?

    bug 
    opened by ajoecker 18
  • webdriver.chrome.binary is ignored

    webdriver.chrome.binary is ignored

    Description of the problem: When running my tests in CI, I want to use the latest (Chrome-Beta) browser. So I set the property:

    webdriver.chrome.binary = /usr/bin/google-chrome-beta
    

    Unfortunately, webdrivermanager ignores this and detects the previous version, from /usr/bin/google-chrome.

    It would be desirable if webdrivermanager respected this property.

    Browser and version: All

    Operating system: All

    WebDriverManager version: 4.1.0

    WebDriverManager use: I use the webdriver manager via Serenity-BDD https://github.com/serenity-bdd/serenity-core

    question 
    opened by SiKing 16
  • Exception resolving chromedriver

    Exception resolving chromedriver

    Hi,

    we've recently decided to add a new build to our CI suite to run the UI tests against a beta version of chrome. We run it with -Dwdm.browserPath=/usr/bin/google-chrome-beta -Dwdm.clearResolutionCache=true. We also pass that path parameter to the created chromedriver so it starts the right binary. I can confirm that part works by logging capabilities.browserVersion: 87.0.4280.40. However, WDM fails to resolve the chromedriver for it:

    WARN  i.g.b.wdm.versions.VersionDetector - Exception reading https://chromedriver.storage.googleapis.com/LATEST_RELEASE_Google Chrome 87.0.4280.40 beta to get latest version of chromedriver (Illegal character in path at index 65: https://chromedriver.storage.googleapis.com/LATEST_RELEASE_Google Chrome 87.0.4280.40 beta)
    INFO  i.g.bonigarcia.wdm.WebDriverManager - Exporting webdriver.chrome.driver as /root/.cache/selenium/chromedriver/linux64/86.0.4240.22/chromedriver 
    

    It looks like there's something wrong with URL building logic, or are we just doing it wrong? We are on 4.2.2 release.

    enhancement 
    opened by seminolas 15
  • Bump assertj-core from 3.24.0 to 3.24.1

    Bump assertj-core from 3.24.0 to 3.24.1

    Bumps assertj-core from 3.24.0 to 3.24.1.

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies java 
    opened by dependabot[bot] 0
  • docker vnc Dynamic port

    docker vnc Dynamic port

    Description of the problem: Hi, I am using WebDriverManager.enableVnc() to create WebDriver, his port is always dynamic, is there any way to fix the port? Browser and version: webdrivermanager.version = 5.0.3

    opened by akwangl 0
  • stopDockerRecording doesn't work when using dockerPrivateEndpoint

    stopDockerRecording doesn't work when using dockerPrivateEndpoint

    Description of the problem: When I configure an image prefix with dockerPrivateEndpoint("docker-proxy.mydomain.de"), then a call to webDriverManager.stopDockerRecording() is not stopping the recording / the video-recorder docker container.

    Browser and version: Firefox 108.0 in docker

    Operating system: Windows 10 64 bit with Docker Desktop for Windows

    WebDriverManager version: maven 5.3.1

    WebDriverManager call:

        WebDriverManager.firefoxdriver()
            .capabilities(createFirefoxOptions())
            .browserInDocker()
            .dockerPrivateEndpoint("docker-proxy.mydomain.de")
            .enableVnc()
            .enableRecording()
            .dockerRecordingOutput(getScreenRecordingPath())
            .dockerNetwork(getDockerNetwork())
            .dockerScreenResolution(getDockerScreenResolution())
            .create();
    

    WebDriverManager traces: I skipped the debug log, as I find the corresponding code snipped and debugger output more helpful. Please let me know if you still need the debug logs or other information.

    In the class io.github.bonigarcia.wdm.WebDriverManager there is the stopDockerRecording method:

        protected synchronized void stopDockerRecording(
                WebDriverBrowser driverBrowser) {
            List<DockerContainer> dockerContainerList = driverBrowser
                    .getDockerContainerList();
            if (dockerContainerList != null && !dockerContainerList.isEmpty()) {
                DockerContainer recorderContainer = dockerContainerList.get(0);
                if (recorderContainer.getImageId()
                        .equals(config().getDockerRecordingImage())) {
                    getDockerService().stopAndRemoveContainer(recorderContainer);
                    dockerContainerList.remove(0);
                }
            }
        }
    

    And it fails when comparing recorderContainer.getImageId().equals(config().getDockerRecordingImage()). dockerContainerList.get(0).getImageId() returns "docker-proxy.mydomain.de/selenoid/video-recorder:7.1", but config().getDockerRecordingImage() only returns "selenoid/video-recorder:7.1".

    Error log: There was no error logged.

    opened by TeJonsch 0
  • getBrowserPath()  The random blocking thread time is very long

    getBrowserPath() The random blocking thread time is very long

     Optional<Path> browserPath = WebDriverManager.chromedriver().getBrowserPath();
      boolean present = browserPath.isPresent();
    

    getBrowserPath() The random blocking thread time is very long

    <dependency>
    	<groupId>io.github.bonigarcia</groupId>
    	<artifactId>webdrivermanager</artifactId>
    	<version>5.3.1</version>
    </dependency>
    

    debian11

    question 
    opened by cosoc 1
  • Added changes on code cleanup and little refactoring on java

    Added changes on code cleanup and little refactoring on java

    Purpose of changes

    Added changes on code cleanup and little refactoring on java

    Types of changes

    • [ ] Bug-fix (non-breaking change which fixes an issue)
    • [ ] New feature (non-breaking change which adds functionality)
    • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)

    How has this been tested?

    Locally

    opened by bipin-k 0
  • Cannot access Chrome DevTools from WebDriverManager.chromedriver().browserInDocker()

    Cannot access Chrome DevTools from WebDriverManager.chromedriver().browserInDocker()

    Description of the problem: Running chrome browser in Docker and attempting to access ChromeDriver DevTools However casting it to the created browser throws an error

    Browser and version: ChromeDriver 107.0.5304.62

    Operating system: Linux

    WebDriverManager version: 5.3.1

    WebDriverManager call: WebDriverManager wdm = WebDriverManager.chromedriver().browserInDocker(); WebDriver driver = wdm.create();

    DevTools chromeDevTools = ((ChromeDriver) driver).getDevTools(); chromeDevTools.createSession();

    WebDriverManager traces:

    Error log: java.lang.ClassCastException at BetTests.java:33

    enhancement 
    opened by seanyyyyyy 2
Releases(webdrivermanager-5.3.1)
Owner
Boni García
Software Engineer & Visiting Professor
Boni García
An implementation of darcy-web that uses Selenium WebDriver as the automation library backend.

darcy-webdriver An implementation of darcy-ui and darcy-web that uses Selenium WebDriver as the automation library backend. maven <dependency> <gr

darcy framework 20 Aug 22, 2020
This is public repository for Selenium Learners at TestLeaf

Selenium WebDriver Course for March 2021 Online Learners This is public repository for Selenium Learners at TestLeaf. Week1 - Core Java Basics How Jav

TestLeaf 86 Dec 29, 2022
jQuery-like cross-driver interface in Java for Selenium WebDriver

seleniumQuery Feature-rich jQuery-like Java interface for Selenium WebDriver seleniumQuery is a feature-rich cross-driver Java library that brings a j

null 69 Nov 27, 2022
Ghost Driver is an implementation of the Remote WebDriver Wire protocol, using PhantomJS as back-end

Ghost Driver is an implementation of the Remote WebDriver Wire protocol, using PhantomJS as back-end

Ivan De Marino 1.9k Dec 15, 2022
An implementation of darcy-web that uses Selenium WebDriver as the automation library backend.

darcy-webdriver An implementation of darcy-ui and darcy-web that uses Selenium WebDriver as the automation library backend. maven <dependency> <gr

darcy framework 20 Aug 22, 2020
A collection of bite size examples for using chrome DevTools protocol commands with Selenium Webdriver v4.

selenium-devtools-guide A collection of bite size examples for using chrome DevTools protocol commands with Selenium Webdriver v4. Chrome Devtools Pro

Sudharsan Selvaraj 4 Aug 12, 2021
This repository contains example codes which will help you to know how to use selenium webdriver.

❓ What is this Repository about? This repo has example codes with Selenium 4 features. Websites used for testing are: automationpractice.com, saucedem

Mohammad Faisal Khatri 86 Dec 30, 2022
Ready-to-use UI Test Automation Architecture using Java and Selenium WebDriver.

Selenium Test Automation Boilerplate Ready-to-use UI Test Automation Architecture using Java and Selenium WebDriver. Languages and Frameworks The proj

Tahanima Chowdhury 133 Dec 26, 2022
Selenium Webdriver: Page Object Model (POM) With Page Factory

Prepare Web Testing Instance or Environment Selenium Webdriver: Page Object Model (POM) With Page Factory Prerequisite software Download & Install JDK

Hiro Mia 14 Oct 18, 2022
This repository includes selenium web driver tests examples using spring boot application.

Selenium Web Driver Tests This repository includes selenium tests examples using custom spring boot application. Overview Run tests Additional Informa

Denys Vozniuk 4 Nov 27, 2022
A FREE Selenium course that takes you step-by-step through building a custom Selenium Framework from scratch.

Selenium For Everyone The book and code repo for the FREE Selenium For Everyone book by Kevin Thomas. FREE Book Download Chapter 1: Getting Started Th

Kevin Thomas 5 May 10, 2022
A sample repo to help you handle basic auth for automation test in Java-selenium on LambdaTest. Run your Java Selenium tests on LambdaTest platform.

How to handle basic auth for automation test in Java-selenium on LambdaTest Prerequisites Install and set environment variable for java. Windows - htt

null 12 Jul 13, 2022
A sample repo to help you clear browser cache with Selenium 4 Java on LambdaTest cloud. Run your Java Selenium tests on LambdaTest platform.

How to clear browser cache with Selenium 4 Java on LambdaTest cloud Prerequisites Install and set environment variable for java. Windows - https://www

null 12 Jul 13, 2022
A sample repo to help you run automation test in incognito mode in Java-selenium on LambdaTest. Run your Java Selenium tests on LambdaTest platform.

How to run automation test in incognito mode in Java-selenium on LambdaTest Prerequisites Install and set environment variable for java. Windows - htt

null 12 Jul 13, 2022
A sample repo to help you handle cookies for automation test in Java-selenium on LambdaTest. Run your Java Selenium tests on LambdaTest platform.

How to handle cookies for automation test in Java-selenium on LambdaTest Prerequisites Install and set environment variable for java. Windows - https:

null 13 Jul 13, 2022
A sample repo to help you set geolocation for automation test in Java-selenium on LambdaTest. Run your Java Selenium tests on LambdaTest platform.

How to set geolocation for automation test in Java-selenium on LambdaTest Prerequisites Install and set environment variable for java. Windows - https

null 12 Jul 13, 2022
A sample repo to help you capture JavaScript exception for automation test in Java-selenium on LambdaTest. Run your Java Selenium tests on LambdaTest platform.

How to capture JavaScript exception for automation test in Java-selenium on LambdaTest Prerequisites Install and set environment variable for java. Wi

null 12 Jul 13, 2022
A sample repo to help you find an element by text for automation test in Java-selenium on LambdaTest. Run your Java Selenium tests on LambdaTest platform.

How to find an element by text for automation test in Java-selenium on LambdaTest Prerequisites Install and set environment variable for java. Windows

null 12 Jul 13, 2022
A sample repo to help you emulate network conditions in Java-selenium automation test on LambdaTest. Run your Java Selenium tests on LambdaTest platform.

How to emulate network conditions in Java-selenium automation test on LambdaTest Prerequisites Install and set environment variable for java. Windows

null 12 Jul 13, 2022
🕵️ Lightweight utility to intercept WebDriver and WebElement method calls.

Lightweight utility to intercept webdriver and webelement method calls. Supports both Selenium and Appium drivers About | To Get Started | Installatio

Sudharsan Selvaraj 24 Jul 1, 2022