To handle this secnario in automation we can use LogonDialogHandler provided in watin framework.
Below is the code snippet to hanlde scenario:
Try
{
Browser browser = new IE();
WatiN.Core.DialogHandlers.LogonDialogHandler ldh = new WatiN.Core.DialogHandlers.LogonDialogHandler(“UserName”,”Password”);
browser.DialogWatcher.Add(ldh);
browser.ShowWindow(WatiN.Core.Native.Windows.NativeMethods.WindowShowStyle.Maximize);
browser.GoTo(“NagiosUrl”);
}
catch (Exception ex)
{
//Handle Exception
}
No comments:
Post a Comment