开发者

How to use confirm dialog handler?

I tried to use the confirm dialog handler to click ok, but it still doesn't make the click. Am I using it right? Here is the code:

var handler = new ReturnDialogHandler();
using (new UseDialogOnce(WebBrowser.Current.DialogWatcher, handler))
{
    开发者_StackOverflow社区WebBrowser.Current.AddDialogHandler(handler);
    WebBrowser.Current.Link("delete").ClickNoWait();
    handler.WaitUntilExists(5);
    handler.OKButton.Click();
    WebBrowser.Current.WaitForComplete();
}


In the unit tests for WatiN that handler is created like this:

var handler = ReturnDialogHandler.CreateInstance();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜