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();
精彩评论