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


C# WebBrowser.OpenBrowser方法代码示例

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


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

示例1: Setup

        public override void Setup()
        {
            _browser = new WebBrowser(_browserType);
            iBrowserInstance = ReflectionHelper.GetField<IBrowser>(_browser, "_browser");
            _browser.OpenBrowser();

            _browser.NavigateBrowser(getTestPage("SightLessUserTestPage.htm"));
            
        }
开发者ID:dineshkummarc,项目名称:SWAT_4.1_Binaries_Source,代码行数:9,代码来源:VisuallyImpairedUserTestFixture.cs

示例2: KeyboardCopyWorksTest

        public void KeyboardCopyWorksTest()
        {
            browser = new WebBrowser(BrowserType.FireFox);

            IBrowser browserObj = (IBrowser) ReflectionHelper.GetField<object>(browser, "_browser");
            KeyboardInput input = new KeyboardInput(browserObj);

            browser.OpenBrowser();
            browser.NavigateBrowser("http://www.google.com");

            input.Copy(GetTestWindowHandle("Google"));

            browser.KillAllOpenBrowsers();
        }
开发者ID:dineshkummarc,项目名称:SWAT_4.1_Binaries_Source,代码行数:14,代码来源:KeyboardInputTestFixture.cs

示例3: SpecialCharactersReturnedFromAssertionJSSHTest

 public void SpecialCharactersReturnedFromAssertionJSSHTest()
 {
     const string elemValue = "Óúña¡í güeeÑe ÉtÜ";
     WebBrowser browser = new WebBrowser(BrowserType.FireFox);
     browser.OpenBrowser();
     string page = string.Format("http://{0}/swat/{1}", Environment.MachineName.ToLower(), "ElementsWithSpecialCharactersPage.htm");
     browser.NavigateBrowser(page);
     try
     {
         browser.AssertElementExists(IdentifierType.Expression, "id=Unicode Character Test;value=" + elemValue, "input");
     }
     finally
     {
         browser.CloseBrowser();
     }
 }
开发者ID:dineshkummarc,项目名称:SWAT_4.1_Binaries_Source,代码行数:16,代码来源:JSSHConnectionTestFixture.cs

示例4: SpecialCharactersReturnedFromBrowserTitleJSSHTest

 public void SpecialCharactersReturnedFromBrowserTitleJSSHTest()
 {
     const string actualTitle = "ConfiguraciÓn salteña¡ krúss caffé¿ bahá'í güe Áetna eÑe Éthernet Ígloo Úruguay Über";
     WebBrowser browser = new WebBrowser(BrowserType.FireFox);
     browser.OpenBrowser();
     string page = string.Format("http://{0}/swat/{1}", Environment.MachineName.ToLower(), "SpanishCharactersPage.html");
     browser.NavigateBrowser(page);
     try
     {
         string title = browser.GetWindowTitle();
         Assert.AreEqual(title, actualTitle);
     }
     finally
     {
         browser.CloseBrowser();
     }
 }
开发者ID:dineshkummarc,项目名称:SWAT_4.1_Binaries_Source,代码行数:17,代码来源:JSSHConnectionTestFixture.cs

示例5: TestPressKeysInSixtyFourBit

        public void TestPressKeysInSixtyFourBit()
        {
            browser = new WebBrowser(BrowserType.InternetExplorer);

            IBrowser browserObj = (IBrowser) ReflectionHelper.GetField<object>(browser, "_browser");
            KeyboardInput input = new KeyboardInput(browserObj);

            browser.OpenBrowser();
            browser.NavigateBrowser("http://www.google.com");

            try
            {
                ReflectionHelper.SetField(input, "forceSixtyFourBit", true);
                input.ProcessKey(NativeMethods.VkKeyScan('a'));
                input.SendInputString(browserObj.GetCurrentWindowTitle());
            }
            finally
            {
                // Clean up
                ReflectionHelper.SetField(input, "forceSixtyFourBit", false);
                browser.KillAllOpenBrowsers();
            }
        }
开发者ID:dineshkummarc,项目名称:SWAT_4.1_Binaries_Source,代码行数:23,代码来源:KeyboardInputTestFixture.cs

示例6: ChromeClosesPortsCorrectlyAfterUseTest

 public void ChromeClosesPortsCorrectlyAfterUseTest()
 {
     _browser = new WebBrowser(BrowserType.Chrome);
     _browser.OpenBrowser();
     _browser.KillAllOpenBrowsers();
 }
开发者ID:dineshkummarc,项目名称:SWAT_4.1_Binaries_Source,代码行数:6,代码来源:ChromeUnitTestFixture.cs

示例7: CloseBrowsersBeforeTestStartTest

        public void CloseBrowsersBeforeTestStartTest()
        {
            // Save the value to reset it later
            bool reset = SWAT.WantCloseBrowsersBeforeTestStart.CloseBrowsersBeforeTestStart;
            string ieProcessName = "iexplore";
            string ffProcessName = "firefox";
            bool areAllIEClosed;
            bool areAllFFClosed;
            WebBrowser _IEBrowser = new WebBrowser(BrowserType.InternetExplorer);
            WebBrowser _FFBrowser = new WebBrowser(BrowserType.FireFox);
            SWAT.Fitnesse.SWATFixture testing;

            // Open multiple windows to close
            _IEBrowser.OpenBrowser();
            _IEBrowser.NavigateBrowser("www.google.com");
            _IEBrowser.OpenBrowser();
            _IEBrowser.NavigateBrowser("www.w3schools.com");

            // Set the user setting to false
            SWAT.WantCloseBrowsersBeforeTestStart.CloseBrowsersBeforeTestStart = false;
            SWAT.UserConfigHandler.Save();

            // SWATFixture's constructor should not kill all open IE browsers
            testing = new InternetExplorerSWATFixture();

            // Assert that all the IE browsers have not closed
            areAllIEClosed = (Process.GetProcessesByName("iexplore").Length == 0);
            Assert.IsFalse(areAllIEClosed, "CloseBrowsersBeforeTestStart failed: " +
                           "closed all windows when the user setting was turned off.");

            // Open multiple windows to close again
            _IEBrowser.OpenBrowser();
            _IEBrowser.NavigateBrowser("www.google.com");
            _IEBrowser.OpenBrowser();
            _IEBrowser.NavigateBrowser("www.w3schools.com");

            // Set the user setting to true
            SWAT.WantCloseBrowsersBeforeTestStart.CloseBrowsersBeforeTestStart = true;
            SWAT.UserConfigHandler.Save();

            // SWATFixture's constructor should kill all open IE browsers
            testing = new InternetExplorerSWATFixture();

            // Assert that all the IE windows have been closed
            areAllIEClosed = (Process.GetProcessesByName(ieProcessName).Length == 0);
            Assert.IsTrue(areAllIEClosed, "CloseBrowsersBeforeTestStart failed: " +
                          "did not close all windows.");

            // Open multiple windows to close again
            _IEBrowser.OpenBrowser();
            _IEBrowser.NavigateBrowser("www.google.com");
            _IEBrowser.OpenBrowser();
            _IEBrowser.NavigateBrowser("www.w3schools.com");

            // Open multiple windows to close again
            _FFBrowser.OpenBrowser();
            _FFBrowser.NavigateBrowser("www.google.com");
            _FFBrowser.OpenBrowser();
            _FFBrowser.NavigateBrowser("www.w3schools.com");

            // SWATFixture's constructor should kill all open IE and FF browsers
            testing = new FireFoxSWATFixture();

            // Assert that all the IE windows have been closed
            areAllIEClosed = (Process.GetProcessesByName(ieProcessName).Length == 0);
            Assert.IsTrue(areAllIEClosed, "CloseBrowsersBeforeTestStart failed: " +
                          "did not close all windows.");

            // Assert that all the FF windows have been closed
            areAllFFClosed = (Process.GetProcessesByName(ffProcessName).Length == 0);
            Assert.IsTrue(areAllFFClosed, "CloseBrowsersBeforeTestStart failed: " +
                          "did not close all windows.");

            // Reset the user config setting
            SWAT.WantCloseBrowsersBeforeTestStart.CloseBrowsersBeforeTestStart = reset;
            SWAT.UserConfigHandler.Save();

        }
开发者ID:dineshkummarc,项目名称:SWAT_4.1_Binaries_Source,代码行数:78,代码来源:FitTests.cs


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