Solucionado (ver solução)
Solucionado
(ver solução)
1
resposta

Dúvida no Ex. 10 da Aula 1 - Testes manuais ou automatizados?

Tentei usar o ChromeDriver no lugar do driver do firefox e retornou o seguinte erro. Como devo proceder?

Exception in thread "main" 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
    at com.google.common.base.Preconditions.checkState(Preconditions.java:199)
    at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:109)
    at org.openqa.selenium.chrome.ChromeDriverService.access$0(ChromeDriverService.java:1)
    at org.openqa.selenium.chrome.ChromeDriverService$Builder.findDefaultExecutable(ChromeDriverService.java:137)
    at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:296)
    at org.openqa.selenium.chrome.ChromeDriverService.createDefaultService(ChromeDriverService.java:88)
    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:116)
    at TesteAutomatizado.main(TesteAutomatizado.java:14)
1 resposta
solução!

Oi Douglas,

Para usar o Chrome, você deverá baixar o ChromeDriver no seguinte endereço: https://sites.google.com/a/chromium.org/chromedriver/downloads

E no seu código adicionar a seguinte linha, que aponta para onde você baixou o ChromeDriver:

public static void main(String[] args) {
    System.setProperty("webdriver.chrome.driver", "C:/ChromeDriver/chromedriver.exe");
    WebDriver driver = new ChromeDriver();

    //restante do codigo
}

Abraços!

Quer mergulhar em tecnologia e aprendizagem?

Receba a newsletter que o nosso CEO escreve pessoalmente, com insights do mercado de trabalho, ciência e desenvolvimento de software