public abstract class FluentBy
extends org.openqa.selenium.By
Mechanism used to locate elements within a document. In order to create your own locating mechanisms, it is possible to subclass this class and override the protected methods as required, though it is expected that that all subclasses rely on the basic finding mechanisms provided through static methods of this class:
public WebElement findElement(WebDriver driver) {
WebElement element = driver.findElement(By.id(getSelector()));
if (element == null)
element = driver.findElement(By.name(getSelector());
return element;
}
| Modifier and Type | Class and Description |
|---|---|
static class |
FluentBy.ByAttribute |
static class |
FluentBy.NotByAttribute |
org.openqa.selenium.By.ByClassName, org.openqa.selenium.By.ByCssSelector, org.openqa.selenium.By.ById, org.openqa.selenium.By.ByLinkText, org.openqa.selenium.By.ByName, org.openqa.selenium.By.ByPartialLinkText, org.openqa.selenium.By.ByTagName, org.openqa.selenium.By.ByXPath| Constructor and Description |
|---|
FluentBy() |
| Modifier and Type | Method and Description |
|---|---|
static FluentBy.ByAttribute |
attribute(java.lang.String name)
Finds elements by the presence of an attribute name irrespective
of element name.
|
static FluentBy.ByAttribute |
attribute(java.lang.String name,
java.lang.String value)
Finds elements by an named attribute matching a given value,
irrespective of element name.
|
void |
beforeFindElement(org.openqa.selenium.WebDriver driver) |
static org.seleniumhq.selenium.fluent.FluentBy.ByComposite |
composite(org.openqa.selenium.By.ByTagName b0,
org.openqa.selenium.By.ByClassName b1)
Finds elements a composite of other By strategies
|
static org.seleniumhq.selenium.fluent.FluentBy.ByComposite |
composite(org.openqa.selenium.By.ByTagName b0,
FluentBy.ByAttribute b1) |
static org.seleniumhq.selenium.fluent.FluentBy.ByLast |
last() |
static org.seleniumhq.selenium.fluent.FluentBy.ByLast |
last(org.openqa.selenium.By by) |
static FluentBy.ByAttribute |
notAttribute(java.lang.String name)
Finds elements by an named attribute not being present in the element,
irrespective of element name.
|
static org.seleniumhq.selenium.fluent.FluentBy.ByStrictClassName |
strictClassName(java.lang.String className)
Finds elements based on the value of the "class" attribute.
|
public void beforeFindElement(org.openqa.selenium.WebDriver driver)
public static org.seleniumhq.selenium.fluent.FluentBy.ByStrictClassName strictClassName(java.lang.String className)
className - The value of the "class" attribute to search forpublic static FluentBy.ByAttribute attribute(java.lang.String name)
public static FluentBy.ByAttribute attribute(java.lang.String name, java.lang.String value)
public static FluentBy.ByAttribute notAttribute(java.lang.String name)
public static org.seleniumhq.selenium.fluent.FluentBy.ByComposite composite(org.openqa.selenium.By.ByTagName b0,
org.openqa.selenium.By.ByClassName b1)
public static org.seleniumhq.selenium.fluent.FluentBy.ByComposite composite(org.openqa.selenium.By.ByTagName b0,
FluentBy.ByAttribute b1)
public static org.seleniumhq.selenium.fluent.FluentBy.ByLast last(org.openqa.selenium.By by)
public static org.seleniumhq.selenium.fluent.FluentBy.ByLast last()
Copyright © 2017. All Rights Reserved.