Using WebDriver Manager in Maven Project
This blog post will demonstrate how to use the WebDriver management in a Maven project.
- Create Maven project as shown in previous blog.
- Create a new package under src/test/java:
Right click on Project name → New → Package → Enter package name → Finish. - Visit Maven Repository: Search/Browse/Explore (mvnrepository.com)
- Search webdrivermanager in the searchbox and select below option
- Select latest version.
- Enter below code in class file you created.
package TestCases;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.edge.EdgeDriver;
import io.github.bonigarcia.wdm.WebDriverManager;
public class TestcaseOne {
public static void main(String[] args) {
// TODO Auto-generated method stub
WebDriverManager.edgedriver().setup();
WebDriver driver = new EdgeDriver();
driver.get("https://www.youtube.com");
driver.manage().window().maximize();
driver.close();
}
}
Comments
Post a Comment