views:

605

answers:

1

How do I get Watin to bypass (or click "OK") when the "this page is being redirected" popup appears when trying to GoTo(url)?

+3  A: 

For managing dialogs watin has WatiN.Core.DialogHandlers,(like AlertDialogHandler, ConfirmDialogHandler, FileUploadDialogHandler, PrintDialogHandler, and LogonDialogHandler.) I think that for your example I think that AlertDialogHandler should be used.

AlertDialogHandler popUp = new AlertDialogHandler();
ie.DialogWatcher.Add(popUp);
ie.GoTO(URL);
if( popUp.Exists())
           {
           popUp.OKButton.Click();
           }
ie.WaitForComplete();
andreja