本文整理匯總了C#中OpenQA.Selenium.By.FindElement方法的典型用法代碼示例。如果您正苦於以下問題:C# By.FindElement方法的具體用法?C# By.FindElement怎麽用?C# By.FindElement使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類OpenQA.Selenium.By
的用法示例。
在下文中一共展示了By.FindElement方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: FindElement
public IWebElement FindElement(By mechanism)
{
return mechanism.FindElement(new ElementFinderContext(currentNode, webBrowser));
}
示例2: FindElement
public IWebElement FindElement(By by)
{
ISearchContext ctx = CreateSearchContext(_my);
return by.FindElement(ctx);
}
示例3: FindElement
public IWebElement FindElement(By by)
{
return by.FindElement(this);
}
示例4: AssertIsElementNotPresent
/// <summary>
/// Verifica se o elemento não está presente na página.
/// </summary>
/// <param name="by">O seletor do elemento.</param>
/// <returns>True se está presente, false no contrário.</returns>
public static void AssertIsElementNotPresent(By by)
{
StepHelper.Attempt(() =>
{
return !IsElementPresent(by);
});
ExceptionAssert.IsThrowing(typeof(NoSuchElementException), () =>
{
by.FindElement(Driver);
});
}
示例5: AssertIsElementPresent
/// <summary>
/// Verifica se o elemento está presente na página.
/// </summary>
/// <param name="by">O seletor do elemento.</param>
/// <returns>True se está presente, false no contrário.</returns>
public static void AssertIsElementPresent(By by)
{
StepHelper.Attempt(() =>
{
return IsElementPresent(by);
});
Assert.IsNotNull(by.FindElement(Driver));
}
示例6: FindElement
public IWebElement FindElement(By by)
{
return by.FindElement(new WebElementFinder(_browser.Page.HtmlNode(), Navigate()));
}
示例7: FindElement
public IWebElement FindElement(By mechanism)
{
return mechanism.FindElement(new ElementFinderContext(_xElement));
}