






















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:
1
WatiN.Core.IE ie = new IE();
2
ie.GoTo("http://localhost/approval");
3
AlertDialogHandler alertDialogHandler = new AlertDialogHandler();
4
ie.AddDialogHandler(alertDialogHandler);
5
ie.Button(Find.ById("BtnSubmit")).ClickNoWait();
6
alertDialogHandler.WaitUntilExists();
7
alertDialogHandler.OKButton.Click();
8
ie.WaitForComplete();
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。