UiCollection
public class UiCollection extends UiObject
UiScrollable |
UiScrollable is a |
Used to enumerate a container's UI elements for the purpose of counting, or targeting a sub elements by a child's text or description.
Summary
Public constructors |
|---|
UiCollection(@NonNull UiSelector selector)Constructs an instance as described by the selector |
Public methods |
|
|---|---|
@NonNull UiObject |
getChildByDescription(Searches for child UI element within the constraints of this UiCollection |
@NonNull UiObject |
getChildByInstance(@NonNull UiSelector childPattern, int instance)Searches for child UI element within the constraints of this UiCollection |
@NonNull UiObject |
getChildByText(@NonNull UiSelector childPattern, @NonNull String text)Searches for child UI element within the constraints of this UiCollection |
int |
getChildCount(@NonNull UiSelector childPattern)Counts child UI element instances matching the |
Inherited Constants |
||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Inherited methods |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Public constructors
UiCollection
public UiCollection(@NonNull UiSelector selector)
Constructs an instance as described by the selector
| Parameters | |
|---|---|
@NonNull UiSelector selector |
Public methods
getChildByDescription
public @NonNull UiObject getChildByDescription(
@NonNull UiSelector childPattern,
@NonNull String text
)
Searches for child UI element within the constraints of this UiCollection 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.
| Parameters | |
|---|---|
@NonNull UiSelector childPattern |
|
@NonNull String text |
String of the identifying child contents of of the |
getChildByInstance
public @NonNull UiObject getChildByInstance(@NonNull UiSelector childPattern, int instance)
Searches for child UI element within the constraints of this UiCollection UiSelector selector. 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.
| Parameters | |
|---|---|
@NonNull UiSelector childPattern |
|
int instance |
int the desired matched instance of this |
getChildByText
public @NonNull UiObject getChildByText(@NonNull UiSelector childPattern, @NonNull String text)
Searches for child UI element within the constraints of this UiCollection UiSelector selector. It looks for any child matching the childPattern argument that has a child UI element anywhere within its sub hierarchy that has text attribute = 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.
| Parameters | |
|---|---|
@NonNull UiSelector childPattern |
|
@NonNull String text |
String of the identifying child contents of of the |
getChildCount
public int getChildCount(@NonNull UiSelector childPattern)
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.
| Parameters | |
|---|---|
@NonNull UiSelector childPattern |
a |
| Returns | |
|---|---|
int |
the number of matched childPattern under the current |