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