本文整理汇总了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
}
}
示例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
}
}
示例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);
}