java.lang.IllegalStateException: The driver executable does not exist: C:\drivers\chromedriver.exe
package br.com.alura.leilao;
import org.junit.jupiter.api.Test;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class HelloWorldSelenium {
@Test
public void hello() {
System.setProperty("webdriver.chrome.driver", "/drivers/chromedriver.exe");
WebDriver browser = new ChromeDriver();
browser.navigate().to("http://localhost:8080/leiloes");
browser.quit();
}
}
Consegui resolver! era uma barra antes do path drivers que eu coloquei sem querer. segue o código atualizado:
package br.com.alura.leilao;
import org.junit.jupiter.api.Test;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class HelloWorldSelenium {
@Test
public void hello() {
System.setProperty("webdriver.chrome.driver", "drivers/chromedriver.exe");
WebDriver browser = new ChromeDriver();
browser.navigate().to("http://localhost:8080/leiloes");
browser.quit();
}
}