Appium Commands

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

 UiSelector

 extends Object

java.lang.Object
↳ android.support.test.uiautomator.UiSelector

 Class Overview

 Specifies the elements in the layout hierarchy for tests to target, filtered by properties such as text value, content-description, class name,
and state information. You can also target an element by its location in a layout hierarchy.

 Summary

Public Constructors

UiSelector()

Public Methods

UiSelector checkable(boolean val)


Set the search criteria to match widgets that are checkable.

UiSelector checked(boolean val)


Set the search criteria to match widgets that are currently checked (usually
for checkboxes).

UiSelector childSelector(UiSelector selector)


Adds a child UiSelector criteria to this selector.

UiSelector className(String className)


Set the search criteria to match the class property for a widget (for example,
"android.widget.Button").

<T> UiSelector className(Class<T> type)


Set the search criteria to match the class property for a widget (for example,
"android.widget.Button").

UiSelector classNameMatches(String regex)


Set the search criteria to match the class property for a widget, using a
regular expression.

UiSelector clickable(boolean val)


Set the search criteria to match widgets that are clickable.
UiSelector description(String desc)
Set the search criteria to match the content-description property for a
widget.

UiSelector descriptionContains(String desc)


Set the search criteria to match the content-description property for a
widget.

UiSelector descriptionMatches(String regex)


Set the search criteria to match the content-description property for a
widget.

UiSelector descriptionStartsWith(String desc)


Set the search criteria to match the content-description property for a
widget.

UiSelector enabled(boolean val)


Set the search criteria to match widgets that are enabled.

UiSelector focusable(boolean val)


Set the search criteria to match widgets that are focusable.

UiSelector focused(boolean val)


Set the search criteria to match widgets that have focus.

UiSelector fromParent(UiSelector selector)


Adds a child UiSelector criteria to this selector which is used to start search
from the parent widget.

UiSelector index(int index)


Set the search criteria to match the widget by its node index in the layout
hierarchy.

UiSelector instance(int instance)


Set the search criteria to match the widget by its instance number.

UiSelector longClickable(boolean val)


Set the search criteria to match widgets that are long-clickable.

UiSelector packageName(String name)


Set the search criteria to match the package name of the application that
contains the widget.
UiSelector packageNameMatches(String regex)
Set the search criteria to match the package name of the application that
contains the widget.

UiSelector resourceId(String id)


Set the search criteria to match the given resource ID.

UiSelector resourceIdMatches(String regex)


Set the search criteria to match the resource ID of the widget, using a
regular expression.

UiSelector scrollable(boolean val)


Set the search criteria to match widgets that are scrollable.

UiSelector selected(boolean val)


Set the search criteria to match widgets that are currently selected.

UiSelector text(String text)


Set the search criteria to match the visible text displayed in a widget (for
example, the text label to launch an app).

UiSelector textContains(String text)


Set the search criteria to match the visible text in a widget where the visible
text must contain the string in your input argument.

UiSelector textMatches(String regex)


Set the search criteria to match the visible text displayed in a layout element,
using a regular expression.

UiSelector textStartsWith(String text)


Set the search criteria to match visible text in a widget that is prefixed by the
text parameter.

String toString()

You might also like