I use selenium-jupiter. I am getting a webdriver from method arguments like this:
@Test
public void testWithChrome(ChromeDriver chromeDriver) {
chromeD
You can do that with WebDriverManager that comes with this extension.
@BeforeEach
public void setUp()
{
switch(browser)
{
case "chrome" ->
{
WebDriverManager.chromedriver().setup();
driver = new ChromeDriver();
}
case "firefox" ->
{
WebDriverManager.firefoxdriver().setup();
driver = new FirefoxDriver();
}
case "edge" ->
{
WebDriverManager.edgedriver().setup();
driver = new EdgeDriver();
}
}
driver.manage().window().maximize();
}