Erro com WebDriver Selenium

5 respostas Resolvido
java
I

Segui todos os passos da video aula 1 do Curso Selenium: Sua webapp testada de ponta a ponta em Java, quando executo o código :

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;

public class Testando {
public static void main(String[] args) {

	
	WebDriver driver = new FirefoxDriver();
	
	driver.get("http://www.google.com.br");
	
	WebElement cmptxt = driver.findElement(By.name("q"));

	cmptxt.sendKeys("testando");
	
	cmptxt.submit();
}
}

Ele retorna um erro, já tentei mudar a lib, mas não consegui sair do lugar. alguem pode me ajudar?

5 Respostas

J

Qual erro? Coloca msg de erro e stacktrace para que alguem possa te ajudar.

I
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 <a href="https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver">https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver</a>. The latest version can be downloaded from <a href="http://chromedriver.storage.googleapis.com/index.html">http://chromedriver.storage.googleapis.com/index.html</a>

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$000(ChromeDriverService.java:32)

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.(ChromeDriver.java:148)

at br.com.teste.Testando.main(Testando.java:13)

Esse é o Erro

D
Solucao aceita

Olá

Creio que isso possa lhe ajudar

I

Obrigado, deu tudo certo.

D

De nada,

é isso ae, qualquer dúvida só manda no GUJ

Boa sorte

Criado 8 de setembro de 2016
Ultima resposta 14 de set. de 2016
Respostas 5
Participantes 3