page.title=UiCollection parent.title=uiautomator parent.link=index.html @jd:body
Used to enumerate a container's user interface (UI) elements for the purpose of counting, or targeting a sub elements by a child's text or description.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
UiCollection(UiSelector selector) |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
UiObject |
getChildByDescription(UiSelector childPattern, String text)
Searches for child UI element within the constraints of this
UiSelector
selector. | ||||||||||
UiObject |
getChildByInstance(UiSelector childPattern, int instance)
Searches for child UI element within the constraints of this
UiSelector . | ||||||||||
UiObject |
getChildByText(UiSelector childPattern, String text)
Searches for child UI element within the constraints of this
UiSelector . | ||||||||||
int |
getChildCount(UiSelector childPattern)
Counts child UI element instances matching the
childPattern
argument. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.android.uiautomator.core.UiObject
| |||||||||||
From class
java.lang.Object
|
Searches for child UI element within the constraints of this UiSelector
selector.
It looks for any child matching the childPattern
argument that has
a child UI element anywhere within its sub hierarchy that has content-description text.
The returned UiObject will point at the childPattern
instance that matched the
search and not at the identifying child element that matched the content description.
childPattern | UiSelector selector of the child pattern to match and return |
---|---|
text | String of the identifying child contents of of the childPattern |
UiObject
pointing at and instance of childPattern
UiObjectNotFoundException |
---|
Searches for child UI element within the constraints of this UiSelector
.
It looks for any child matching the childPattern
argument that has
a child UI element anywhere within its sub hierarchy that is at the instance
specified. The operation is performed only on the visible items and no scrolling is performed
in this case.
childPattern | UiSelector selector of the child pattern to match and return |
---|---|
instance | int the desired matched instance of this childPattern |
UiObject
pointing at and instance of childPattern
UiObjectNotFoundException |
---|
Searches for child UI element within the constraints of this UiSelector
selector.
It looks for any child matching the childPattern
argument that has
a child UI element anywhere within its sub hierarchy that has a text attribute equal to
text
. The returned UiObject will point at the childPattern
instance that matched the search and not at the identifying child element that matched the
text attribute.
childPattern | UiSelector selector of the child pattern to match and return |
---|---|
text | String of the identifying child contents of of the childPattern |
UiObject
pointing at and instance of childPattern
UiObjectNotFoundException |
---|
Counts child UI element instances matching the childPattern
argument. The method returns the number of matching UI elements that are
currently visible. The count does not include items of a scrollable list
that are off-screen.
childPattern | a UiSelector that represents the matching child UI
elements to count |
---|
UiCollection