本文整理汇总了C#中IWebDriver.webDriverWait方法的典型用法代码示例。如果您正苦于以下问题:C# IWebDriver.webDriverWait方法的具体用法?C# IWebDriver.webDriverWait怎么用?C# IWebDriver.webDriverWait使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IWebDriver
的用法示例。
在下文中一共展示了IWebDriver.webDriverWait方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: betaShopLogin
//劲舞团页面商城用户登录
public static void betaShopLogin(string userName, string password, IWebDriver driver)
{
driver.FindElement(By.LinkText("用户登录")).Click();
driver.webDriverWait(By.Id("userName"), 5).SendKeys(userName);
driver.FindElement(By.Id("password")).SendKeys(password);
driver.FindElement(By.Id("identifyingCode")).SendKeys("1111");
driver.FindElement(By.Id("submitlog")).Click();
}
示例2: buyExpInBack
//返现币购买100MB经验
public static void buyExpInBack(string userName, IWebDriver driver)
{
driver.Navigate().GoToUrl("http://betashop.9you.com/item/show/pkey/kBoubnG61322652566");
driver.webDriverWait(By.LinkText("送给朋友"), 5).Click();
driver.FindElement(By.CssSelector("input[name='special']")).SendKeys("100");
driver.FindElement(By.CssSelector("input[name='getusername']")).SendKeys(userName);
driver.FindElement(By.CssSelector("input[name='getusername_r']")).SendKeys(userName);
driver.FindElement(By.CssSelector("form#Sendmode>p>input.n_checkbox")).Click();
driver.FindElement(By.CssSelector("form[id='Sendmode']>p>input[data-type='server-selector']")).Click();
Thread.Sleep(500);
driver.FindElement(By.LinkText("特别体验区")).Click();
Thread.Sleep(500);
driver.FindElement(By.CssSelector("form#Sendmode>a.n_qdBtn")).Click();
Thread.Sleep(500);
SwitchToFrame(driver, "//iframe[contains(@class,'fancybox-iframe')]");
driver.FindElement(By.Id("bt1")).Click();
driver.SwitchTo().DefaultContent();
driver.FindElement(By.CssSelector("a.fancybox-item.fancybox-close")).Click();
}
示例3: buySelf1200
//给自己买1200道具
public static void buySelf1200(IWebDriver driver)
{
driver.Navigate().GoToUrl("http://betashop.9you.com/item/show/pkey/B7IOSWvt1428477629/eq/0");
driver.FindElement(By.CssSelector("form[id='Buymode']>p>input[data-type='server-selector']")).Click();
Thread.Sleep(500);
driver.webDriverWait(By.LinkText("特别体验区"), 5).Click();
Thread.Sleep(500);
driver.FindElement(By.CssSelector("form#Buymode>a.n_qdBtn")).Click();
Thread.Sleep(500);
SwitchToFrame(driver, "//iframe[contains(@class,'fancybox-iframe')]");
driver.FindElement(By.Id("bt1")).Click();
driver.SwitchTo().DefaultContent();
driver.FindElement(By.CssSelector("a.fancybox-item.fancybox-close")).Click();
}
示例4: SwitchToFrame
//切换至特定iframe
public static void SwitchToFrame(IWebDriver driver, string _xpath)
{
IWebElement oneIframe = driver.webDriverWait(By.XPath(_xpath), 5);
driver.SwitchTo().Frame(oneIframe);
}
示例5: sendRing_2
//送个朋友戒指到特别体验区
public static void sendRing_2(IWebDriver driver, string getRingUser)
{
switchToAnotherWindow(driver);
driver.webDriverWait(By.LinkText("送给朋友"), 5).Click();
driver.FindElement(By.CssSelector("input[name='getusername']")).SendKeys(getRingUser);
driver.FindElement(By.CssSelector("input[name='getusername_r']")).SendKeys(getRingUser);
driver.FindElement(By.CssSelector("form[id='Sendmode']>p>input[data-type='server-selector']")).Click();
Thread.Sleep(500);
driver.FindElement(By.LinkText("特别体验区")).Click();
Thread.Sleep(500);
driver.FindElement(By.CssSelector("form#Sendmode>a.n_qdBtn")).Click();
}
示例6: sendRing
public static void sendRing(IWebDriver driver)
{
switchToAnotherWindow(driver);
driver.FindElement(By.CssSelector("form[id='Buymode']>p>input[data-type='server-selector']")).Click();
Thread.Sleep(500);
driver.webDriverWait(By.LinkText("特别体验区"), 5).Click();
Thread.Sleep(500);
driver.FindElement(By.CssSelector("form#Buymode>a.n_qdBtn")).Click();
}
示例7: getConsBadge
//跳转
public static void getConsBadge(IWebDriver driver, string userName, string password, string consBadgeID, string URLExten)
{
driver.Navigate().GoToUrl("http://betashop.9you.com/active/active/name/ConsBadge" + URLExten);
betaShopLogin(userName, password, driver);
driver.webDriverWait(By.XPath("//input[contains(@value,'" + consBadgeID + "')]"), 5).Click();
driver.FindElement(By.Id("n_input_0")).Click();
Thread.Sleep(500);
driver.FindElement(By.LinkText("特别体验区")).Click();
Thread.Sleep(500);
driver.FindElement(By.Id("tj")).Click();
}