import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
public class ChromeExample {
public static void main(String[] args) {
// abre chrome
WebDriver driver = new ChromeDriver();
System.setProperty("webdriver.chrome.driver","C:\\Users\\adelo\\OneDrive\\Documentos\\testes-de-sistema\\driver\\chromedriver.exe");
// acessa o site do google
driver.get("http://www.google.com.br/");
// digita no campo com nome "q" do google
WebElement campoDeTexto = driver.findElement(By.name("q"));
campoDeTexto.sendKeys("Caelum");
// submete o form
campoDeTexto.submit();
}
}