【发布时间】:2015-04-08 20:31:58
【问题描述】:
对于我的 UI 测试,我使用带有 webdriver(版本 2.45.0)的页面工厂模型。对于驱动程序,我使用 phantomjs(版本 1.9.8)。在一个单独的类中,我有一个类似的方法:
public WebElement waitTillNotVisible(By locator, WebDriver driver){
return new WebDriverWait(driver, 10).
until(ExpectedConditions.invisibilityOfElementLocated(locator));
}
每次调用 waitTillNotVisible 时,控制台日志中都会出现错误,
[ERROR - 2015-04-08T11:30:18.149Z] WebElementLocator - _handleLocateCommand - Element(s) NOT Found: GAVE UP. Search Stop Time: 1428492618108
但测试继续并通过。这种行为的原因是什么,如何避免?这在我看来就像是 phantomjs 的错误,因为在使用 FirefoxDriver 进行测试时不会出现这样的消息。
【问题讨论】: