本文整理汇总了C#中IWebDriver.GetHashCode方法的典型用法代码示例。如果您正苦于以下问题:C# IWebDriver.GetHashCode方法的具体用法?C# IWebDriver.GetHashCode怎么用?C# IWebDriver.GetHashCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IWebDriver
的用法示例。
在下文中一共展示了IWebDriver.GetHashCode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestMethod1
public void TestMethod1()
{
//testTarget = targ;
//testID = "UI-" + tclass + "-" + tsubclass + "-" + tID;
//testClass = tclass;
//testSubClass = tsubclass;
testRegressionCandidate = false;
testStatus = states[0];
testClass = "TIT";
testSubClass = "IE";
testTarget = "visitor";
testUrl = "http://10.141.10.20:8080/Account/Login?ReturnUrl=%2f";
switch (this.testSubClass)
{
case "FF":
// Create a new instance of the Firefox driver.
//driver = new FirefoxDriver();
driver = new FirefoxDriver(new FirefoxProfile(""));
break;
case "IE":
// Create a new instance of the Firefox driver.
driver = new InternetExplorerDriver();
break;
case "AS":
// Create a new instance of the Firefox driver.
driver = new SafariDriver();
break;
case "GC":
// Create a new instance of the Firefox driver.
driver = new ChromeDriver();
break;
default:
System.Console.Error.WriteLine("ERROR: Invalid test subclass");
Environment.Exit(-1);
break;
}
switch (this.testClass)
{
case ("TIT"):
try
{
//driver.Navigate().GoToUrl("http://www.google.com/");
driver.Navigate().GoToUrl(testUrl);
// Find the text input element by its name
//IWebElement query = driver.FindElement(By.Name("q"));
IWebElement loginF = driver.FindElement(By.ClassName("form-hideLabels"));
IWebElement uName = driver.FindElement(By.Id("UserName"));
IWebElement uPass = driver.FindElement(By.Id("Password"));
System.Console.WriteLine(driver.GetType());
System.Console.WriteLine(driver.GetHashCode());
int wdr = driver.Manage().GetHashCode();
// Enter something to search for
uName.SendKeys("admin");
uPass.SendKeys("1234");
// Now submit the form. WebDriver will find the form for us from the element
loginF.Submit();
}
catch (OpenQA.Selenium.NoSuchElementException nsee)
{
driver.Quit();
System.Console.Error.WriteLine("ERROR: Exception trying to reach a page element");
System.Console.Error.WriteLine(nsee.Message);
Thread.Sleep(5000);
response = null;
Environment.Exit(-2);
}
catch (OpenQA.Selenium.NoSuchWindowException nswe) {
driver.Quit();
System.Console.Error.WriteLine("ERROR: Exception trying to reach a window");
System.Console.Error.WriteLine(nswe.Message);
Thread.Sleep(5000);
response = null;
Environment.Exit(-2);
}
catch
{
driver.Quit();
System.Console.Error.WriteLine("ERROR: Other error");
Thread.Sleep(5000);
response = null;
Environment.Exit(-2);
}
//.........这里部分代码省略.........