Utilizando o ChromeDriver encontrei o seguinte erro:
Exception in thread "main" java.lang.NoSuchMethodError: 'void org.apache.http.params.HttpConnectionParams.setSoReuseaddr(org.apache.http.params.HttpParams, boolean)'
at org.openqa.selenium.remote.internal.HttpClientFactory.getHttpParams(HttpClientFactory.java:82)
at org.openqa.selenium.remote.internal.HttpClientFactory.<init>(HttpClientFactory.java:51)
at org.openqa.selenium.remote.HttpCommandExecutor.<init>(HttpCommandExecutor.java:111)
at org.openqa.selenium.chrome.ChromeCommandExecutor.<init>(ChromeCommandExecutor.java:30)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:144)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:86)
at TesteAutomatizado.main(TesteAutomatizado.java:12)
Esse é o meu código:
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
public class TesteAutomatizado {
public static void main(String[] args) {
System.setProperty("webdriver.chrome.driver", "C:/Eclipse/chromedriver/chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.get("http://www.google.com.br");
WebElement campoDeTexto = driver.findElement(By.name("q"));
campoDeTexto.sendKeys("Cedro");
campoDeTexto.submit();
};
};