By
class By
By is a utility class which enables the creation of BySelectors in a concise manner.
Its primary function is to provide static factory methods for constructing BySelectors using a shortened syntax. For example, you would use findObject(By.text("foo")) rather than findObject(new BySelector().text("foo")) to select UI elements with the text value "foo".
Summary
Nested types |
|---|
class By.WindowThis nested class is used to create a |
Public functions |
|
|---|---|
java-static BySelector |
Constructs a new |
java-static BySelector |
Constructs a new |
java-static BySelector |
Constructs a new |
java-static BySelector |
Constructs a new |
java-static BySelector |
Constructs a new |
java-static BySelector |
Constructs a new |
java-static BySelector |
Constructs a new |
java-static BySelector |
copy(original: BySelector)Constructs a new |
java-static BySelector |
Constructs a new |
java-static BySelector |
Constructs a new |
java-static BySelector |
Constructs a new |
java-static BySelector |
descContains(substring: String)Constructs a new |
java-static BySelector |
descEndsWith(suffix: String)Constructs a new |
java-static BySelector |
descStartsWith(prefix: String)Constructs a new |
java-static BySelector |
@RequiresApi(value = 30)Constructs a new |
java-static BySelector |
Constructs a new |
java-static BySelector |
Constructs a new |
java-static BySelector |
Constructs a new |
java-static BySelector |
hasAncestor(ancestorSelector: BySelector)Constructs a new |
java-static BySelector |
hasAncestor(Constructs a new |
java-static BySelector |
hasChild(childSelector: BySelector)Constructs a new |
java-static BySelector |
hasDescendant(descendantSelector: BySelector)Constructs a new |
java-static BySelector |
hasDescendant(descendantSelector: BySelector, maxDepth: Int)Constructs a new |
java-static BySelector |
hasParent(parentSelector: BySelector)Constructs a new |
java-static BySelector |
@RequiresApi(value = 26)Constructs a new |
java-static BySelector |
@RequiresApi(value = 26)Constructs a new |
java-static BySelector |
@RequiresApi(value = 26)Constructs a new |
java-static BySelector |
@RequiresApi(value = 26)Constructs a new |
java-static BySelector |
@RequiresApi(value = 26)Constructs a new |
java-static BySelector |
longClickable(isLongClickable: Boolean)Constructs a new |
java-static BySelector |
Constructs a new |
java-static BySelector |
Constructs a new |
java-static BySelector |
Constructs a new |
java-static BySelector |
Constructs a new |
java-static BySelector |
Constructs a new |
java-static BySelector |
scrollable(isScrollable: Boolean)Constructs a new |
java-static BySelector |
Constructs a new |
java-static BySelector |
Constructs a new |
java-static BySelector |
Constructs a new |
java-static BySelector |
textContains(substring: String)Constructs a new |
java-static BySelector |
textEndsWith(suffix: String)Constructs a new |
java-static BySelector |
textStartsWith(prefix: String)Constructs a new |
Public functions
checkable
java-static fun checkable(isCheckable: Boolean): BySelector
Constructs a new BySelector and sets the checkable criteria.
| See also | |
|---|---|
checkable |
BySelector.checkable(boolean) |
checked
java-static fun checked(isChecked: Boolean): BySelector
Constructs a new BySelector and sets the checked criteria.
| See also | |
|---|---|
checked |
BySelector.checked(boolean) |
clazz
java-static fun clazz(className: Pattern): BySelector
Constructs a new BySelector and sets the class name criteria.
| See also | |
|---|---|
clazz |
BySelector.clazz(Pattern) |
clazz
java-static fun clazz(className: String): BySelector
Constructs a new BySelector and sets the class name criteria.
| See also | |
|---|---|
clazz |
BySelector.clazz(String) |
clazz
java-static fun clazz(clazz: Class): BySelector
Constructs a new BySelector and sets the class name criteria.
| See also | |
|---|---|
clazz |
BySelector.clazz(Class) |
clazz
java-static fun clazz(packageName: String, className: String): BySelector
Constructs a new BySelector and sets the class name criteria.
| See also | |
|---|---|
clazz |
BySelector.clazz(String, String) |
clickable
java-static fun clickable(isClickable: Boolean): BySelector
Constructs a new BySelector and sets the clickable criteria.
| See also | |
|---|---|
clickable |
BySelector.clickable(boolean) |
copy
java-static fun copy(original: BySelector): BySelector
Constructs a new BySelector and copies the criteria from original.
depth
java-static fun depth(depth: Int): BySelector
Constructs a new BySelector and sets the depth criteria.
desc
java-static fun desc(contentDescription: Pattern): BySelector
Constructs a new BySelector and sets the content description criteria.
| See also | |
|---|---|
desc |
BySelector.desc(Pattern) |
desc
java-static fun desc(contentDescription: String): BySelector
Constructs a new BySelector and sets the content description criteria.
| See also | |
|---|---|
desc |
BySelector.desc(String) |
descContains
java-static fun descContains(substring: String): BySelector
Constructs a new BySelector and sets the content description criteria.
| See also | |
|---|---|
descContains |
BySelector.descContains(String) |
descEndsWith
java-static fun descEndsWith(suffix: String): BySelector
Constructs a new BySelector and sets the content description criteria.
| See also | |
|---|---|
descEndsWith |
BySelector.descEndsWith(String) |
descStartsWith
java-static fun descStartsWith(prefix: String): BySelector
Constructs a new BySelector and sets the content description criteria.
| See also | |
|---|---|
descStartsWith |
BySelector.descStartsWith(String) |
displayId
@RequiresApi(value = 30)
java-static fun displayId(displayId: Int): BySelector
Constructs a new BySelector and sets the display ID criteria.
| See also | |
|---|---|
displayId |
BySelector.displayId(int) |
enabled
java-static fun enabled(isEnabled: Boolean): BySelector
Constructs a new BySelector and sets the enabled criteria.
| See also | |
|---|---|
enabled |
BySelector.enabled(boolean) |
focusable
java-static fun focusable(isFocusable: Boolean): BySelector
Constructs a new BySelector and sets the focusable criteria.
| See also | |
|---|---|
focusable |
BySelector.focusable(boolean) |
focused
java-static fun focused(isFocused: Boolean): BySelector
Constructs a new BySelector and sets the focused criteria.
| See also | |
|---|---|
focused |
BySelector.focused(boolean) |
hasAncestor
java-static fun hasAncestor(ancestorSelector: BySelector): BySelector
Constructs a new BySelector and adds an ancestor selector criteria.
| See also | |
|---|---|
hasAncestor |
BySelector.hasAncestor(BySelector) |
hasAncestor
java-static fun hasAncestor(
ancestorSelector: BySelector,
maxAncestorDistance: @IntRange(from = 1) Int
): BySelector
Constructs a new BySelector and adds an ancestor selector criteria.
| See also | |
|---|---|
hasAncestor |
BySelector.hasAncestor(BySelector, int) |
hasChild
java-static fun hasChild(childSelector: BySelector): BySelector
Constructs a new BySelector and adds a child selector criteria.
| See also | |
|---|---|
hasChild |
BySelector.hasChild(BySelector) |
hasDescendant
java-static fun hasDescendant(descendantSelector: BySelector): BySelector
Constructs a new BySelector and adds a descendant selector criteria.
| See also | |
|---|---|
hasDescendant |
BySelector.hasDescendant(BySelector) |
hasDescendant
java-static fun hasDescendant(descendantSelector: BySelector, maxDepth: Int): BySelector
Constructs a new BySelector and adds a descendant selector criteria.
| See also | |
|---|---|
hasDescendant |
BySelector.hasDescendant(BySelector, int) |
hasParent
java-static fun hasParent(parentSelector: BySelector): BySelector
Constructs a new BySelector and adds a parent selector criteria.
| See also | |
|---|---|
hasParent |
BySelector.hasParent(BySelector) |
hint
@RequiresApi(value = 26)
java-static fun hint(hint: String): BySelector
Constructs a new BySelector and sets the hint value criteria.
| See also | |
|---|---|
hint |
BySelector.hint(String) |
hint
@RequiresApi(value = 26)
java-static fun hint(regex: Pattern): BySelector
Constructs a new BySelector and sets the hint value criteria.
| See also | |
|---|---|
hint |
BySelector.hint(Pattern) |
hintContains
@RequiresApi(value = 26)
java-static fun hintContains(substring: String): BySelector
Constructs a new BySelector and sets the hint value criteria.
| See also | |
|---|---|
hintContains |
BySelector.hintContains(String) |
hintEndsWith
@RequiresApi(value = 26)
java-static fun hintEndsWith(suffix: String): BySelector
Constructs a new BySelector and sets the hint value criteria.
| See also | |
|---|---|
hintEndsWith |
BySelector.hintEndsWith(String) |
hintStartsWith
@RequiresApi(value = 26)
java-static fun hintStartsWith(prefix: String): BySelector
Constructs a new BySelector and sets the hint value criteria.
| See also | |
|---|---|
hintStartsWith |
BySelector.hintStartsWith(String) |
longClickable
java-static fun longClickable(isLongClickable: Boolean): BySelector
Constructs a new BySelector and sets the long clickable criteria.
| See also | |
|---|---|
longClickable |
BySelector.longClickable(boolean) |
pkg
java-static fun pkg(applicationPackage: Pattern): BySelector
Constructs a new BySelector and sets the application package name criteria.
| See also | |
|---|---|
pkg |
BySelector.pkg(Pattern) |
pkg
java-static fun pkg(applicationPackage: String): BySelector
Constructs a new BySelector and sets the application package name criteria.
| See also | |
|---|---|
pkg |
BySelector.pkg(String) |
res
java-static fun res(resourceName: Pattern): BySelector
Constructs a new BySelector and sets the resource id criteria.
| See also | |
|---|---|
res |
BySelector.res(Pattern) |
res
java-static fun res(resourceName: String): BySelector
Constructs a new BySelector and sets the resource name criteria.
| See also | |
|---|---|
res |
BySelector.res(String) |
res
java-static fun res(resourcePackage: String, resourceId: String): BySelector
Constructs a new BySelector and sets the resource name criteria.
| See also | |
|---|---|
res |
BySelector.res(String, String) |
scrollable
java-static fun scrollable(isScrollable: Boolean): BySelector
Constructs a new BySelector and sets the scrollable criteria.
| See also | |
|---|---|
scrollable |
BySelector.scrollable(boolean) |
selected
java-static fun selected(isSelected: Boolean): BySelector
Constructs a new BySelector and sets the selected criteria.
| See also | |
|---|---|
selected |
BySelector.selected(boolean) |
text
java-static fun text(regex: Pattern): BySelector
Constructs a new BySelector and sets the text value criteria.
| See also | |
|---|---|
text |
BySelector.text(Pattern) |
text
java-static fun text(text: String): BySelector
Constructs a new BySelector and sets the text value criteria.
| See also | |
|---|---|
text |
BySelector.text(String) |
textContains
java-static fun textContains(substring: String): BySelector
Constructs a new BySelector and sets the text value criteria.
| See also | |
|---|---|
textContains |
BySelector.textContains(String) |
textEndsWith
java-static fun textEndsWith(suffix: String): BySelector
Constructs a new BySelector and sets the text value criteria.
| See also | |
|---|---|
textEndsWith |
BySelector.textEndsWith(String) |
textStartsWith
java-static fun textStartsWith(prefix: String): BySelector
Constructs a new BySelector and sets the text value criteria.
| See also | |
|---|---|
textStartsWith |
BySelector.textStartsWith(String) |