import org.junit.Test; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; public class SignIn { @Test public void testSignIn() throws InterruptedException { // Optional. If not specified, WebDriver searches the PATH for chromedriver. // System.setProperty("webdriver.chrome.driver", "C:/swy/s/webdriver/bin/chromedriver.exe"); WebDriver driver = new ChromeDriver(); //1.get the url driver.get("http://www.google.com/"); Thread.sleep(5000); // Let the user actually see something! //2.Find the search Text box in the page WebElement searchBox = driver.findElement(By.name("q")); //3.Input the search text searchBox.sendKeys("ChromeDriver"); //4.Press the submit button searchBox.submit(); Thread.sleep(5000); // Let the user actually see something! //5.Close all the browser driver.quit(); } }