package TestDemo;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.ie.InternetExplorerDriver;
public class Test_0425 {
private static String baseurl = "http://baidu.com";
public static void main(String []args){
WebDriver driver = new InternetExplorerDriver();
try {
driver.get(baseurl);//打开页面;
String title = driver.getTitle();//获取title;
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);// 页面加载时间10秒;
WebElement element = driver.findElement(By.id("kw"));
element.sendKeys("成都");
element.submit();
}
catch (Exception e){
System.out.println(e);
}
finally {
driver.quit();
}
}
}