我试试这个测试:webdriver的,Selenium2 - 简单的测试失败
@Test
public void theUserShouldBeAbleToTypeInQueryTerms() {
WebDriver driver = new FirefoxDriver();
driver.get("http://www.google.com");
WebElement queryField = driver.findElement(By.name("q"));
queryField.sendKeys("cats");
queryField.submit();
assertThat(driver.getTitle(), containsString("cats"));
}
,但得到了一个错误:
Failure, Expected: a string containing "cats" got: "Google"
我怎样才能修改测试有成功?