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


C# ISelenium.Stop方法代码示例

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


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

示例1: TestMethod1

        public void TestMethod1()
        {
            selenium = new DefaultSelenium("localhost", 4444, "*iexplore", "http://www.google.com/");
            selenium.Start();

            selenium.Open("/");
            selenium.Type("q", "selenium rc");
            selenium.Click("btnG");
            selenium.WaitForPageToLoad("30000");
            Assert.AreEqual("selenium rc - Google Search", selenium.GetTitle());

            try
            {
                selenium.Stop();
            }
            catch (Exception)
            {
                // Ignore errors if unable to close the browser
            }
        }
开发者ID:shivanisharma,项目名称:test,代码行数:20,代码来源:UnitTest1.cs

示例2: TestMethod2

        public void TestMethod2()
        {
            selenium = new DefaultSelenium("localhost", 4444, "*iexplore", "http://localhost:1987");
            selenium.Start();
            selenium.Open("/WebSite1/");
            selenium.Type("MainContent_TextBox1", "HUM");
            selenium.Click("MainContent_Button1");
            selenium.WaitForPageToLoad("3000770");

            //Get the Table Value of Row 1 and Coulumn 2
            object GG = selenium.GetTable("MainContent_GridView1.1.2");

            Assert.AreEqual("1", "1");
            try
            {
                selenium.Stop();
            }
            catch (Exception)
            {
                // Ignore errors if unable to close the browser
            }
        }
开发者ID:shivanisharma,项目名称:test,代码行数:22,代码来源:UnitTest1.cs

示例3: DisposeInstance

        /// <summary>
        /// Disposes of an instance of selenium
        /// </summary>
        /// <param name="instance">The instance to be disposed</param>
        /// <remarks>This method only needs to be called if a specific instance of selenium has been created
        /// and used rather than the default instance provided by the class</remarks>
        public void DisposeInstance(ISelenium instance)
        {
            try
            {
                if(SeleniumServerStarted)
                    instance.Stop();
            }
            catch
            {
                // If we get an error here not so worried as currently removing the instance.
                // We don't want to throw an error in case it stops the tests running
            }

            Instances.Remove(instance);
        }
开发者ID:girish66,项目名称:Unit-Test-Utilities,代码行数:21,代码来源:SeleniumSupport.cs


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