public static enum Locator.ByLocator extends Enum<Locator.ByLocator>
| Enum Constant and Description |
|---|
CLASS |
CSS |
ID |
LINK_TEXT |
NAME |
PARTIAL_LINK_TEXT |
TAG |
URL
URL are only for pages
|
XPATH |
| Modifier and Type | Method and Description |
|---|---|
Optional<org.openqa.selenium.WebElement> |
locate(org.openqa.selenium.SearchContext parent,
String selector)
Locates the web element on the current page using the appropriate locator strategy
|
Optional<org.openqa.selenium.WebElement> |
locate(String selector)
Locates the web element on the current page using the appropriate locator strategy
|
static Locator.ByLocator |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Locator.ByLocator[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
org.openqa.selenium.By |
withSelector(String selector)
Transforms the ByLocator to a Selenium
By literal. |
public static final Locator.ByLocator URL
public static final Locator.ByLocator ID
public static final Locator.ByLocator LINK_TEXT
public static final Locator.ByLocator PARTIAL_LINK_TEXT
public static final Locator.ByLocator NAME
public static final Locator.ByLocator TAG
public static final Locator.ByLocator XPATH
public static final Locator.ByLocator CLASS
public static final Locator.ByLocator CSS
public static Locator.ByLocator[] values()
for (Locator.ByLocator c : Locator.ByLocator.values()) System.out.println(c);
public static Locator.ByLocator valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic Optional<org.openqa.selenium.WebElement> locate(String selector)
selector - the selector for the element to selectpublic Optional<org.openqa.selenium.WebElement> locate(org.openqa.selenium.SearchContext parent, String selector)
selector - the selector for the element to selectpublic org.openqa.selenium.By withSelector(String selector)
By literal.selector - the selector StringCopyright © 2016 DevCon5 GmbH. All rights reserved.