【发布时间】:2016-08-30 12:04:11
【问题描述】:
这是我的代码:
try {
WebDriverWait wait = new WebDriverWait(driver, 10);
Alert alert = wait.until(ExpectedConditions.alertIsPresent());
//Accepting alert.
alert.accept();
System.out.println("Accepted the alert successfully.");
} catch(Throwable e) {
System.err.println("Error came while waiting for the alert popup. "+e.getMessage());
}
错误显示如下:
等待弹出警报时出现错误。预期条件失败:等待警报出现(以 500 MILLISECONDS 间隔尝试 10 秒)
【问题讨论】:
-
需要检查您的页面是否是 javascript 警报???
-
先生,感谢您的回复。它是一个 javascript 警报消息,它是一个基于窗口的我认为 autoit 工具对此很有用.. 你的意见是什么?马上告诉我?等待回复..