- 博客(0)
- 资源 (3)
空空如也
README.txt
package selenium;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.htmlunit.HtmlUnitDriver;
import static junit.framework.Assert.assertNotNull;
public class WebDriverTest {
private WebDriver page;
@Before
public void before() {
page = new HtmlUnitDriver();
}
@Test
public void testHasAnImageSearchPage() throws Exception {
page.get("http://www.google.cn");
WebElement searchBox = page.findElement(By.name("q"));
searchBox.sendKeys("JavaEye");
WebElement subBtn = page.findElement(By.name("btnG"));
subBtn.submit();
WebElement result = page.findElement(By.linkText("http://www.javaeye.com"));
assertNotNull(result);
}
}
2013-05-14
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人