Selenium Automation

Tutorial No 2 : Automate Google Search with Selenium

Automate Google Search
									

package test.sel.java.org;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;

public class Testing {
public static void main(String[] args) {
WebDriver driver = new ChromeDriver();
System.setProperty("webdriver.chrome.driver", "E:\\chromedriver.exe");
driver.get("https://google.co.in");
String searchElement = "W3TechBlog";
WebElement search = driver.findElement(By.name("q"));
search.sendKeys(searchElement);
}
}