0
我已经使用下面的代码来测试JavaScript简单验证。
下面是我用于WatiN的代码。asp.net watin:执行测试时使用watin在asp.net中发生错误?
[STAThread]
static void Main(string[] args)
{
IE ie = new IE("http://localhost:2034/WebForm3.aspx");
ie.ShowWindow(WatiN.Core.Native.Windows.NativeMethods.WindowShowStyle.Maximize);
var confirm = new ConfirmDialogHandler();
ie.AddDialogHandler(confirm);
ie.TextField("TextBox1").TypeText("Pa");
ie.Button("Button2").ClickNoWait();
//dialoghandler.WaitUntilExists(5);
confirm.OKButton.Click();
var dialoghandler = new AlertDialogHandler();
ie.AddDialogHandler(confirm);
**dialoghandler.OKButton.Click();**//the error is could not find dialog does not exist.
dialoghandler.WaitUntilExists(10);
}