package cn.helloselenium; import org.openqa.selenium.*; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.By; public class FristWebDriver { public static void main(String[] args) { // TODO Auto-generated method stub System.setProperty("webdriver.gecko.driver", "C:\Program Files (x86)\Mozilla Firefox\geckodriver.exe"); WebDriver driver = new FirefoxDriver(); driver.get("http://www.baidu.com/"); driver.findElement(By.id("kw")).sendKeys("selenium java"); driver.findElement(By.id("su")).click(); //driver.quit(); } }