我正在使用watir-webdriver来驱动web应用程序的测试运行。
有问题的页面对输入更改的响应是确认,然后是翻页,最后是警告。
**更新**
我已经尝试了以下操作,但我得到了一个从确认块开始的Selenium::WebDriver::Error::UnhandledAlertError。
require "watir-webdriver/extensions/alerts"
b.alert do
b.confirm(true) do
b.checkbox(:index => 1).set
end
end
**结束更新**
但是,添加以下内容(在输
我在Selenium中使用WebDriverWait,如果某个警报或确认框出现,我想等待10秒,如果它显示,我将接受它。例如,如果“确认”框要求我“离开页面”或“停留在页面上”,那么我希望自动离开页面,如果10秒内没有出现警报,则继续代码删除,而不是抛出异常。或者,您可以告诉我在整个selenium测试期间接受所有确认、警报框的方法。谢谢,这是我的密码
WebDriver driver = new FirefoxDriver();
driver.get("https:www.google.com");
WebDriverWait wait = new Web
我正在尝试使用Selenium单击打开的应用程序警报,并得到了这个错误。
NoAlertPresentException: Message: no such alert
因此,基本上,我试图从浏览器中打开缩放应用程序。
,这是我的代码:
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exc
我在我的应用程序中使用了来自eriktufvesson的AngularJS,并且正如在中提到的,如何在警报中使用回调函数:
bootbox.alert({
message: "This is an alert with a callback!",
callback: function () {
console.log('This was logged in the callback!');
}
})
这是我的密码:
$ngBootbox.alert({
size: "small",
titl
有一个测试,选择一个单选按钮,然后点击一个删除按钮触发一个模态对话框/警告框弹出。
我使用的是Cucumber,下面是步骤的工作原理:
When /^i confirm the alert$/ do
Watir::Wait.until(timeout: 10) {@browser.alert.exists?}
puts "i see the alert"
@browser.alert.ok
end
我提出了这个懒散的调试步骤,因为我认为这可能是一个浏览器/驱动程序问题。
我已经在Chrome中做过这项工作,但对于我在这个特定脚本中所处的特