Windows安全对话框问题

时间:2012-11-22 15:37:22

标签: c# watin

我在使用WatiN处理Win7中的Windows安全弹出窗口时遇到问题。我正在尝试从这里解决方案:   [1]:WatiN LogonDialogHandlers not working correctly in Windows 7(最后一个答案)。请不加修改地使用代码,我的电话:

Ie.DialogWatcher.Add(new Windows7LogonDialogHandler(user, passw));
Ie.GoTo(url);

但得到错误:

Exception was thrown while DialogWatcher called HandleDialog: System.InvalidOperationException: Sequence contains no elements
   at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)

此时:

var another = (from AutomationElement list in lists
                               where list.Current.ClassName == "UserTile"
                               where list.Current.Name == "Use another account"
                               select list).First();

我错过了什么?

0 个答案:

没有答案