waitFor
fun UiDevice.waitFor(selector: BySelector, timeoutMs: Long = DEFAULT_WAIT_FOR_TIMEOUT_MS): UiObject2
Content copied to clipboard
Helper method to wait for a given selector to be found.
Tries to find an object for the selector periodically until the timeout specified by timeoutMs expires. When no object matches within the given timeoutMs, an IllegalStateException is thrown.