当前位置: 首页>>代码示例>>C#>>正文


C# IE.GoTo方法代码示例

本文整理汇总了C#中IE.GoTo方法的典型用法代码示例。如果您正苦于以下问题:C# IE.GoTo方法的具体用法?C# IE.GoTo怎么用?C# IE.GoTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IE的用法示例。


在下文中一共展示了IE.GoTo方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Should_detect_error

 public void Should_detect_error()
 {
     using (var ie = new IE())
     {
          var ieClass = (InternetExplorerClass) ie.InternetExplorer;
          var doc = (IHTMLDocument2) ieClass.Document;
          var window = (HTMLWindowEvents_Event) doc.parentWindow;
          window.onerror += (description, url, line) => Console.WriteLine(@"{0}: '{1}' on line {2}", url, description, line);
          ie.GoTo(@"D:\Projects\WatiN\Support\ErrorInJavascript\Test.html");
          ie.GoTo("google.com");
          ie.GoTo(@"D:\Projects\WatiN\Support\ErrorInJavascript\Test.html");
     }
 }
开发者ID:exaphaser,项目名称:WatiN,代码行数:13,代码来源:JavascriptErrorDetection.cs

示例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();
        }
开发者ID:fschwiet,项目名称:watin_unbranched,代码行数:12,代码来源:FileDownloadHandlerTests.cs

示例3: LogonDialogTest

		public void LogonDialogTest()
		{
			using (var ie = new IE())
			{
				var logonDialogHandler = new LogonDialogHandler("test", "this");
				using (new UseDialogOnce(ie.DialogWatcher, logonDialogHandler))
				{
					
					ie.GoTo("http://irisresearch.library.cornell.edu/control/authBasic/authTest");
				}
				ie.WaitUntilContainsText("Basic Authentication test passed successfully",5);
			}
		}
开发者ID:fschwiet,项目名称:WatiN-2.0.20.1089-net-2.0,代码行数:13,代码来源:LogonDialogHandlerTests.cs

示例4: 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();
        }
开发者ID:fschwiet,项目名称:watin_unbranched,代码行数:13,代码来源:FileDownloadHandlerTests.cs

示例5: DownloadSave

        public void DownloadSave()
        {
            var file = new FileInfo(@"c:\temp\test.zip");
            file.Directory.Create();
            file.Delete();
            Assert.That(file.Exists, Is.False, file.FullName + " file should not exist before download");

            var fileDownloadHandler = new FileDownloadHandler(file.FullName);

            using (var ie = new IE())
            {
                ie.AddDialogHandler(fileDownloadHandler);

            //				ie.GoTo("http://watin.sourceforge.net/WatiN-1.0.0.4000-net-1.1.msi");
                        ie.GoTo("http://watin.sourceforge.net/WatiNRecorder.zip");

                fileDownloadHandler.WaitUntilFileDownloadDialogIsHandled(15);
                fileDownloadHandler.WaitUntilDownloadCompleted(200);
            }

            file = new FileInfo(@"c:\temp\test.zip");
            Assert.IsTrue(file.Exists, file.FullName + " file does not exist after download");
        }
开发者ID:fschwiet,项目名称:watin_unbranched,代码行数:23,代码来源:FileDownloadHandlerTests.cs

示例6: ClearCache

        public void ClearCache()
        {
            using (var ie = new IE(GoogleUrl))
            {
                // Testing cache clearing directly is a little difficult because we cannot
                // easily enumerate its contents without using system APIs.
                // We could create a sample page that includes a nonce but says it's cacheable
                // forever.  Then we should only observe the change on refresh or cache clearing.
                // Fortunately Google has already done it for us.

                // Save the original page html.
                var oldHtml = GetHtmlSource(ie);

                // If we navigate to the page again, we should see identical Html.
                ie.GoTo(GoogleUrl);
                Assert.AreEqual(oldHtml, GetHtmlSource(ie), "HTML should be identical when pulling from the cache.");

                // But after clearing the cache, things are different.
                ie.ClearCache();
                ie.GoTo(GoogleUrl);
                Assert.AreNotEqual(oldHtml, GetHtmlSource(ie), "HTML should differ after cache has been cleared.");
            }
        }
开发者ID:koshdim,项目名称:KoWatIn,代码行数:23,代码来源:IETests.cs


注:本文中的IE.GoTo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。