# IdlingUiController

# IdlingUiController

Artifact:[androidx.test.espresso:espresso-core](https://developer.android.com/jetpack/androidx/releases/test-espresso)  
[View Source](https://cs.android.com/search?q=file:androidx/test/espresso/base/IdlingUiController.java+class:androidx.test.espresso.base.IdlingUiController)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/test/espresso/base/IdlingUiController "View this page in Java")

<br />

```
interface IdlingUiController : UiController
```

<br />

*** ** * ** ***

Similar to[UiController](https://developer.android.com/reference/kotlin/androidx/test/espresso/UiController)but with one additional method that enables getting an instance of[IdlingResourceRegistry](https://developer.android.com/reference/kotlin/androidx/test/espresso/base/IdlingResourceRegistry). For instance, the registry can then be used by[androidx.test.espresso.ViewAction](https://developer.android.com/reference/kotlin/androidx/test/espresso/ViewAction)to register and unregister idling resources before and after performing the actual action.

This interface used for Espresso internals and shouldn't be called by external users.

## Summary

|                                                      ### Public functions                                                      |
|--------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [IdlingResourceRegistry](https://developer.android.com/reference/kotlin/androidx/test/espresso/base/IdlingResourceRegistry)`!` | [getIdlingResourceRegistry](https://developer.android.com/reference/kotlin/androidx/test/espresso/base/IdlingUiController#getIdlingResourceRegistry())`()` Returns an instance of[IdlingResourceRegistry](https://developer.android.com/reference/kotlin/androidx/test/espresso/base/IdlingResourceRegistry). |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ### Inherited functions                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From[androidx.test.espresso.UiController](https://developer.android.com/reference/kotlin/androidx/test/espresso/UiController) |-------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | [injectKeyEvent](https://developer.android.com/reference/kotlin/androidx/test/espresso/UiController#injectKeyEvent(android.view.KeyEvent))`(event: `[KeyEvent](https://developer.android.com/reference/android/view/KeyEvent.html)`!)` Injects a key event into the application.                                                                                                                                                                                                                             | | [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | [injectMotionEvent](https://developer.android.com/reference/kotlin/androidx/test/espresso/UiController#injectMotionEvent(android.view.MotionEvent))`(event: `[MotionEvent](https://developer.android.com/reference/android/view/MotionEvent.html)`!)` Injects a motion event into the application.                                                                                                                                                                                                           | | [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | [injectMotionEventSequence](https://developer.android.com/reference/kotlin/androidx/test/espresso/UiController#injectMotionEventSequence(java.lang.Iterable<android.view.MotionEvent>))`(events: (`[Mutable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-iterable/index.html)`)`[Iterable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-iterable/index.html)`<`[MotionEvent](https://developer.android.com/reference/android/view/MotionEvent.html)`!>!)` | | [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | [injectString](https://developer.android.com/reference/kotlin/androidx/test/espresso/UiController#injectString(java.lang.String))`(str: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!)` Types a string into the application using series of[KeyEvent](https://developer.android.com/reference/android/view/KeyEvent.html)s.                                                                                                                                           | | [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)       | [loopMainThreadForAtLeast](https://developer.android.com/reference/kotlin/androidx/test/espresso/UiController#loopMainThreadForAtLeast(long))`(millisDelay: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`)` Loops the main thread for a specified period of time.                                                                                                                                                                                                          | | [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)       | [loopMainThreadUntilIdle](https://developer.android.com/reference/kotlin/androidx/test/espresso/UiController#loopMainThreadUntilIdle())`()` Loops the main thread until the application goes idle.                                                                                                                                                                                                                                                                                                           | |

## Public functions

### getIdlingResourceRegistry

```
fun getIdlingResourceRegistry(): IdlingResourceRegistry!
```

Returns an instance of[IdlingResourceRegistry](https://developer.android.com/reference/kotlin/androidx/test/espresso/base/IdlingResourceRegistry).