private String baseUrl="http://www.baidu.com/"; --------- @Test public void testLoginB() throws Exception { driver.get(baseUrl); Thread.sleep(500); driver.findElement(By.linkText("登录")).click(); driver.findElement(By.id("TANGRAM__PSP_8__userName")).click(); driver.findElement(By.id("TANGRAM__PSP_8__userName")).sendKeys("username"); driver.findElement(By.id("TANGRAM__PSP_8__password")).click(); driver.findElement(By.id("TANGRAM__PSP_8__password")).sendKeys("password"); driver.findElement(By.id("TANGRAM__PSP_8__submit")).click(); }