Reputation: 19
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))
{
WebBrowser.Current.AddDialogHandler(handler);
WebBrowser.Current.Link("delete").ClickNoWait();
handler.WaitUntilExists(5);
handler.OKButton.Click();
WebBrowser.Current.WaitForComplete();
}
Upvotes: 1
Views: 550
Reputation: 282
In the unit tests for WatiN that handler is created like this:
var handler = ReturnDialogHandler.CreateInstance();
Upvotes: 1