Olá,
Estou montando um setup básico de teste para um projeto já existente.
Utilizando maven, adicionei as seguintes dependências:
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.11.0</version>
</dependency>
<dependency>
<groupId>io.github.bonigarcia</groupId>
<artifactId>webdrivermanager</artifactId>
<version>2.2.1</version>
</dependency>
E na classe de teste, comecei com o código:
public class TestWebDriver {
private WebDriver driver;
@BeforeClass
public static void setupClass() {
WebDriverManager.chromedriver().setup();
}
@BeforeTest
public void setupTest() {
driver = new ChromeDriver();
}
@AfterClass
public void teardown() {
if (driver != null) {
driver.quit();
}
}
@Test
public void test() {
driver.get("https://www.google.com");
}
}
Do que eu entendi, toda aquela configuração do driver do Chrome seria feito pela dependência "webdrivermanager", mas continuo com o erro:
java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.chrome.driver system property; for more information, see https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver. The latest version can be downloaded from http://chromedriver.storage.googleapis.com/index.html
Alguém usa essa dependência? É a melhor forma de fazer o setup ou devo baixar mesmo o driver do chrome?
Obrigada.