Tentando escrever um codigo simples pra digitar uma palavra "Sinal" na pagina do google, mas tomando erro no chromedriver mesmo tendo baixado e configurado o path. Alguma sugestão ?
Segue codigo:
package com.tdd.Globo2;
import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; public class PaginaGlobo {
public static void main(String[] args) {
System.setProperty("Webdriver.chrome.driver", "C:\Users\CarlosLuciano\Desktop\primeup\chromedriver_win32\chromedriver.exe");
// abre chrome WebDriver driver = new ChromeDriver();
driver.get("http://www.google.com.br");
WebElement CampodeTexto = driver.findElement(By.name("q")); CampodeTexto.sendKeys("Sinal"); CampodeTexto.submit();
} } ERRO: 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:847) at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:124) 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:339) at org.openqa.selenium.chrome.ChromeDriverService.createDefaultService(ChromeDriverService.java:88) at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:123) at com.tdd.Globo2.PaginaGlobo.main(PaginaGlobo.java:14)