本文整理汇总了C#中IE.WaitForComplete方法的典型用法代码示例。如果您正苦于以下问题:C# IE.WaitForComplete方法的具体用法?C# IE.WaitForComplete怎么用?C# IE.WaitForComplete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IE
的用法示例。
在下文中一共展示了IE.WaitForComplete方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FinishInitializationAndWaitForComplete
public Browser FinishInitializationAndWaitForComplete(IE ie, SimpleTimer timer, bool waitForComplete)
{
ie.FinishInitialization(null);
if (waitForComplete)
{
var ieWaitForComplete = new IEWaitForComplete((IEBrowser) ie.NativeBrowser) { Timer = timer };
ie.WaitForComplete(ieWaitForComplete);
}
return ie;
}
示例2: DownloadRun
public void DownloadRun()
{
var dhdl = new FileDownloadHandler(FileDownloadOptionEnum.Run);
var ie = new IE();
ie.AddDialogHandler(dhdl);
ie.WaitForComplete();
ie.GoTo("http://watin.sourceforge.net/WatiN-1.0.0.4000-net-1.1.msi");
dhdl.WaitUntilFileDownloadDialogIsHandled(5);
dhdl.WaitUntilDownloadCompleted(20);
ie.Close();
}
示例3: DownloadOpen
public void DownloadOpen()
{
var dhdl = new FileDownloadHandler(FileDownloadOptionEnum.Open);
var ie = new IE();
ie.AddDialogHandler(dhdl);
ie.WaitForComplete();
ie.GoTo("http://watin.sourceforge.net/WatiNRecorder.zip");
dhdl.WaitUntilFileDownloadDialogIsHandled(5);
dhdl.WaitUntilDownloadCompleted(20);
ie.Close();
}
示例4: CloseSpecificBrowserAlert
public void CloseSpecificBrowserAlert()
{
Assert.AreEqual(0, Ie.DialogWatcher.Count, "DialogWatcher count should be zero");
var firstIE = Ie;
firstIE.RunScript("document.title = 'firstIe'; ");
using (var secondIe = new IE(TestPageUri,true))
{
secondIe.RunScript("document.title = 'secondIe'; ");
// set up a second browser with an open dialog
var secondAlertDialogHandler = new AlertDialogHandler();
using (new UseDialogOnce(secondIe.DialogWatcher, secondAlertDialogHandler))
{
secondIe.Button(Find.ByValue("Show alert dialog")).ClickNoWait();
secondAlertDialogHandler.WaitUntilExists(5);
// close the original message
var firstAlertDialogHandler = new AlertDialogHandler();
using (new UseDialogOnce(firstIE.DialogWatcher, firstAlertDialogHandler))
{
firstIE.Button(Find.ByValue("Show alert dialog")).ClickNoWait();
firstAlertDialogHandler.WaitUntilExists(5);
var message = firstAlertDialogHandler.Message;
firstAlertDialogHandler.OKButton.Click();
firstIE.WaitForComplete(5);
Assert.IsTrue(secondAlertDialogHandler.Exists(), "Original Alert Dialog should be open.");
Assert.AreEqual("This is an alert!", message, "Unexpected message");
Assert.IsFalse(firstAlertDialogHandler.Exists(), "Alert Dialog should be closed.");
}
// close the second message
secondAlertDialogHandler.OKButton.Click();
secondIe.WaitForComplete(5);
Assert.IsFalse(secondAlertDialogHandler.Exists(), "Alert Dialog should be closed.");
}
}
}