WatiN ie9确认对话框不起作用 [英] WatiN ie9 confirm dialog is not working
本文介绍了WatiN ie9确认对话框不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
可能重复:
Watin& IE9-不能单击确定"按钮
Possible Duplicate:
Watin & IE9 - Cant click ok buttons
var dialogHandler = new WatiN.Core.DialogHandlers.ConfirmDialogHandler();
using (new WatiN.Core.DialogHandlers.UseDialogOnce(browser.DialogWatcher, dialogHandler))
{
browser.Button(Find.ById("btnSave")).ClickNoWait();
dialogHandler.WaitUntilExists();
}
无法正常运行,即9,javascript确认 我已经使用了最新版本2.1
it's not working on ie 9, javascript confirm I already use latest version 2.1
推荐答案
我的项目中包含以下代码:
I have the following code in my project:
var cancel = browser.Link(Find.ByUrl(CANCEL_LINK));
var confirmDialog = new ConfirmDialogHandler();
using (new UseDialogOnce(browser.DialogWatcher, confirmDialog))
{
cancel.ClickNoWait();
confirmDialog.WaitUntilExists();
confirmDialog.OKButton.Click();
browser.WaitForComplete();
}
这在IE9中有效.请注意,它是WatiN v2.0.50727,但我认为这与您运行v2.1不会有所不同.
This works in IE9. Note that it is WatiN v2.0.50727, but I don't see that this should make a difference with you running v2.1.
这篇关于WatiN ie9确认对话框不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文