public enum LocatorStrategy extends java.lang.Enum<LocatorStrategy> implements ValueEnum
In order to
make these identifiers as robust as possible across minor changes to an application, (such as skin changes, minor layout
changes, etc) the system will store multiple pieces of information about a component when generating an identification
string to retrieve it from a list of candidates. The system has a default strategy for choosing the order in which to
look at these pieces of information but in some cases this can be overridden by setting a LocatorStrategy
.
By default we use the following strategies in order to identify a component from a list of candidates:
name
: Does not apply in all cases but in cases where a specified name
attribute has
meaning we will use it - for example for sections
in a section stack
.title
: If a title is specified for the component this may be used as a
legitimate identifier if it is unique within the component - for example differently titled tabs within a tabset.index
: Locating by index is typically less robust than by name or title as it is likely to be
effected by layout changes on the page. Note that we also support
matching by type (see LocatorTypeStrategy
). Matching by type is used if we were unable
to match by name or title or to disambiguate between multiple components with a matching title.
Enum Constant and Description |
---|
INDEX
Match by index
|
NAME
Match by name if possible.
|
TITLE
Match by title if possible.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getValue() |
static LocatorStrategy |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static LocatorStrategy[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final LocatorStrategy NAME
public static final LocatorStrategy TITLE
public static final LocatorStrategy INDEX
public static LocatorStrategy[] values()
for (LocatorStrategy c : LocatorStrategy.values()) System.out.println(c);
public static LocatorStrategy valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null