I'm evaluationg WebAii framework and run accross an issue with hadling IE8 login dialog
The simple approach does not work:
Manager.LaunchNewBrowser(
BrowserType.InternetExplorer);
Manager.DialogMonitor.AddDialog(
new LogonDialog(ActiveBrowser, "username, "password", DialogButton.OK));
Manager.DialogMonitor.Start();
ActiveBrowser.NavigateTo(
"Url");
Afther a quite long search I have found an example of authetication for FF
public void FireFoxLogin()
{
// Launch a browser instance
Manager.LaunchNewBrowser(
BrowserType.FireFox);
GenericDialog g = new GenericDialog(ActiveBrowser, "", false);
g.HandlerDelegate =
this.HandleFireFoxLoginDialog;
g.Title =
"Authentication Required";
Manager.DialogMonitor.AddDialog(g);
Manager.DialogMonitor.Start();
//Launch Login Dialog Here
ActiveBrowser.NavigateTo(
"url");
g.WaitUntilHandled();
Manager.DialogMonitor.Stop();
}
public void HandleFireFoxLoginDialog(IDialog dialog)
{
Desktop.KeyBoard.SendString(
"username");
System.Threading.
Thread.Sleep(1000);
Desktop.KeyBoard.SendString(
"{TAB}");
Desktop.KeyBoard.SendString(
"password");
Desktop.KeyBoard.SendString(
"{TAB}");
Desktop.KeyBoard.SendString(
"{ENTER}");
Manager.DialogMonitor.RemoveDialog(dialog);
}
Unfortuanately this approach is not wokting in internet explorer - the handler delagate is never called
Could you advice of what i have done wrong ?