https://github.com/bonigarcia/webdrivermanager-examples
JUnit tests with Selenium WebDriver and WebDriverManager
https://github.com/bonigarcia/webdrivermanager-examples
java junit junit5 selenium selenium-webdriver webdrivermanager
Last synced: 3 months ago
JSON representation
JUnit tests with Selenium WebDriver and WebDriverManager
- Host: GitHub
- URL: https://github.com/bonigarcia/webdrivermanager-examples
- Owner: bonigarcia
- License: apache-2.0
- Created: 2016-11-16T08:05:09.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2025-03-24T06:27:29.000Z (4 months ago)
- Last Synced: 2025-03-28T21:08:46.070Z (4 months ago)
- Topics: java, junit, junit5, selenium, selenium-webdriver, webdrivermanager
- Language: Java
- Homepage: https://bonigarcia.dev/webdrivermanager/
- Size: 801 KB
- Stars: 117
- Watchers: 16
- Forks: 59
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
[](https://search.maven.org/#search%7Cga%7C1%7Cg%3Aio.github.bonigarcia%20a%3Awebdrivermanager)
[](https://github.com/bonigarcia/webdrivermanager-examples/actions)
[](https://www.oracle.com/java/technologies/downloads/)
[](https://www.apache.org/licenses/LICENSE-2.0)
[](#backers)
[](#sponsors)
[](https://stackoverflow.com/questions/tagged/webdrivermanager-java)
[](https://twitter.com/boni_gg)# WebDriverManager Examples [![][Logo]][GitHub Repository]
This repository contains JUnit examples to automate the [Selenium WebDriver] driver management using [WebDriverManager]. These examples are 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`:
```xml
io.github.bonigarcia
webdrivermanager
${wdm.version}
test```
... or in a Gradle project:
```
dependencies {
testImplementation("io.github.bonigarcia:webdrivermanager:${wdm.version}")
}
```Then you can let WebDriverManager to manage the drivers required by Selenium WebDriver (e.g., chromedriver, geckodriver). For example, as a JUnit test using Chrome browser:
```java
class ChromeTest {WebDriver driver;
@BeforeAll
static void setupClass() {
WebDriverManager.chromedriver().setup();
}@BeforeEach
void setupTest() {
driver = new ChromeDriver();
}@AfterEach
void teardown() {
driver.quit();
}@Test
void test() {
// Your test code here
}}
```... or using Firefox:
```java
class FirefoxTest {WebDriver driver;
@BeforeAll
static void setupClass() {
WebDriverManager.firefoxdriver().setup();
}@BeforeEach
void setupTest() {
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-2023) is a personal project of [Boni Garcia] licensed under [Apache 2.0 License].
[Apache 2.0 License]: https://www.apache.org/licenses/LICENSE-2.0
[Boni Garcia]: https://bonigarcia.github.io/
[Selenium WebDriver]: https://docs.seleniumhq.org/projects/webdriver/
[WebDriverManager]:https://github.com/bonigarcia/webdrivermanager/
[Logo]: https://bonigarcia.github.io/img/webdrivermanager.png
[GitHub Repository]: https://github.com/bonigarcia/webdrivermanager-examples
[Stack Overflow]: https://stackoverflow.com/questions/tagged/webdrivermanager-java
[OpenCollective]: https://opencollective.com/webdrivermanager
[donation]: https://opencollective.com/webdrivermanager/donate
[recurring contribution]: https://opencollective.com/webdrivermanager/contribute/backer-8132/checkout
[sponsor]: https://opencollective.com/webdrivermanager/contribute/sponsor-8133/checkout