Skip to content

bonigarcia/webdrivermanager-basic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

WebDriverManager Basic

This repository contains a basic project with JUnit tests using Selenium WebDriver and WebDriverManager. This code is open source, released under the terms of Apache 2.0 License.

Usage

In order to use WebDriverManager from tests in a Maven project, you need to add the following dependency in your pom.xml:

<dependency>
    <groupId>io.github.bonigarcia</groupId>
    <artifactId>webdrivermanager</artifactId>
    <version>${wdm.version}</version>
    <scope>test</scope>
</dependency>

... or in Gradle project:

dependencies {
    testImplementation("io.github.bonigarcia:webdrivermanager:${wdm.version}")
}

Then you can let WebDriverManager to manage automatically the required drivers by Selenium WebDriver (e.g., chromedriver, geckodriver, etc.) for your application/test. For example, as a JUnit test using Chrome browser:

class ChromeTest {

    WebDriver driver;

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

    @BeforeEach
    void setup() {
        driver = new ChromeDriver();
    }

    @AfterEach
    void teardown() {
        driver.quit();
    }

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

}

... and using Firefox:

class FirefoxTest {

    WebDriver driver;

    @BeforeAll
    static void setupClass() {
        WebDriverManager.firefoxdriver().setup();
    }

    @BeforeEach
    void setup() {
        driver = new FirefoxDriver();
    }

    @AfterEach
    void teardown() {
        driver.quit();
    }

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

}

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.

Support

WebDriverManager is part of OpenCollective, an online funding platform for open and transparent communities. You can support the project by contributing as a backer (i.e., a personal donation or recurring contribution) or as a sponsor (i.e., a recurring contribution by a company).

Backers

Sponsors

About

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

About

Basic project with JUnit tests using Selenium Webdriver and WebDriverManager

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages