# Searchable

Artifact: [androidx.test.uiautomator:uiautomator](https://developer.android.com/jetpack/androidx/releases/test-uiautomator) [View Source](https://cs.android.com/search?q=file:androidx/test/uiautomator/Searchable.java+class:androidx.test.uiautomator.Searchable) Added in [2.4.1](https://developer.android.com/jetpack/androidx/releases/test-uiautomator#2.4.1)

*** ** * ** ***


```
interface Searchable
```

<br />

Known direct subclasses [UiDevice](https://developer.android.com/reference/kotlin/androidx/test/uiautomator/UiDevice), [UiObject2](https://developer.android.com/reference/kotlin/androidx/test/uiautomator/UiObject2), [UiWindow](https://developer.android.com/reference/kotlin/androidx/test/uiautomator/UiWindow)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/test/uiautomator/UiDevice` | UiDevice provides access to state information about the device. |
| `https://developer.android.com/reference/kotlin/androidx/test/uiautomator/UiObject2` | Represents a UI element, and exposes methods for performing gestures (clicks, swipes) or searching through its children. |
| `https://developer.android.com/reference/kotlin/androidx/test/uiautomator/UiWindow` | Represents a UI window on the screen and provides methods to access its properties and perform actions. |

*** ** * ** ***

The Searchable interface represents an object that can be searched for matching UI elements.

## Summary

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/test/uiautomator/UiObject2!` | `https://developer.android.com/reference/kotlin/androidx/test/uiautomator/Searchable#findObject(androidx.test.uiautomator.BySelector)(selector: https://developer.android.com/reference/kotlin/androidx/test/uiautomator/BySelector)` Returns the first object to match the `selector` criteria. |
| `(https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/test/uiautomator/UiObject2!>` | `https://developer.android.com/reference/kotlin/androidx/test/uiautomator/Searchable#findObjects(androidx.test.uiautomator.BySelector)(selector: https://developer.android.com/reference/kotlin/androidx/test/uiautomator/BySelector)` Returns all objects that match the `selector` criteria. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/test/uiautomator/Searchable#hasObject(androidx.test.uiautomator.BySelector)(selector: https://developer.android.com/reference/kotlin/androidx/test/uiautomator/BySelector)` Returns whether there is a match for the given `selector` criteria. |

## Public functions

### findObject

Added in [2.4.1](https://developer.android.com/jetpack/androidx/releases/test-uiautomator#2.4.1)

```
fun findObject(selector: BySelector): UiObject2!
```

Returns the first object to match the `selector` criteria.

### findObjects

Added in [2.4.1](https://developer.android.com/jetpack/androidx/releases/test-uiautomator#2.4.1)

```
fun findObjects(selector: BySelector): (Mutable)List<UiObject2!>
```

Returns all objects that match the `selector` criteria.

### hasObject

Added in [2.4.1](https://developer.android.com/jetpack/androidx/releases/test-uiautomator#2.4.1)

```
fun hasObject(selector: BySelector): Boolean
```

Returns whether there is a match for the given `selector` criteria.