惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - Franky
D
Docker
Jina AI
Jina AI
The GitHub Blog
The GitHub Blog
博客园 - 聂微东
B
Blog RSS Feed
大猫的无限游戏
大猫的无限游戏
M
MIT News - Artificial intelligence
Vercel News
Vercel News
Microsoft Security Blog
Microsoft Security Blog
博客园 - 叶小钗
爱范儿
爱范儿
D
DataBreaches.Net
Hugging Face - Blog
Hugging Face - Blog
IT之家
IT之家
Recent Announcements
Recent Announcements
U
Unit 42
腾讯CDC
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
宝玉的分享
宝玉的分享
量子位
Stack Overflow Blog
Stack Overflow Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Microsoft Azure Blog
Microsoft Azure Blog

博客园 - WebQ

工作流软件升级完成 !!!!!!求救:.Net调用迅雷的问题!!!!! 行政审批工作流系统寻求合作 地铁上的遭遇 开始升级我的工作流系统 IE7中如何子窗口只在关闭时刷新opener 英文标点符号翻译大全 One Bug of WatiN? - WebQ How to pass a input parameter in Script task of SSIS Working overtime The Tongsha ferry (通沙汽渡) over Changjiang river 实现COM组件访问.Net组件的方法 a article about Polymorphism ASP.NET 页面对象模型 Object Serailization What is WSDL? 自定义控件中UserControl(用户控件)和CustomControl(自定义控件)的区别 常见的手机英语 Callback with event and delegate over .net remoting
Handle alert dialog with WatiN
WebQ · 2007-05-22 · via 博客园 - WebQ

      Useful objects of WatiN are DialogHandlers.We can use one of them : AlertDialogHandler to handle a window.alert dialog.
However the WatiN Recoder still generate correct codes about such a scenario so far(But I always think WatiN Recoder is a very graet tool).
Let's look the completely correct  codes as follows:

1WatiN.Core.IE ie = new IE();
2ie.GoTo("http://localhost/approval");
3AlertDialogHandler alertDialogHandler = new AlertDialogHandler();
4ie.AddDialogHandler(alertDialogHandler);
5ie.Button(Find.ById("BtnSubmit")).ClickNoWait();
6alertDialogHandler.WaitUntilExists();
7alertDialogHandler.OKButton.Click();
8ie.WaitForComplete();