importjava.util.Iterator;importjava.util.List;importjava.util.Set;importjava.util.concurrent.TimeUnit;importorg.openqa.selenium.Alert;importorg.openqa.selenium.By;importorg.openqa.selenium.Cookie;importorg.openqa.selenium.JavascriptExecutor;importorg.openqa.selenium.WebDriver;importorg.openqa.selenium.WebElement;importorg.openqa.selenium.chrome.ChromeDriver;importorg.openqa.selenium.interactions.Actions;importorg.openqa.selenium.support.ui.Select;public classTest1 {public static voidmain(String[] args) {
System.setProperty("webdriver.chrome.driver", "D:\\webDriver\\chromedriver.exe");//chromedriver服务地址
WebDriver driver = new ChromeDriver(); //新建一个WebDriver 的对象,但是new 的是谷歌的驱动
String url = "http://www.baidu.com";
driver.get(url);//打开指定的网站//driver.navigate().to(url);//打开指定的网站
/**
* driver.findElement(By.id("kw")).sendKeys(new String[] { "hello&