# android.support.test.uiautomator

# android.support.test.uiautomator

| This package is part of the Android[support library](https://developer.android.com/topic/libraries/support-library)which is no longer maintained. The support library has been superseded by[AndroidX](https://developer.android.com/jetpack/androidx)which is part of[Jetpack](https://developer.android.com/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider[migrating](https://developer.android.com/jetpack/androidx/migrate)existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library[class mappings](https://developer.android.com/jetpack/androidx/migrate/class-mappings).

## Interfaces

|-------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [IAutomationSupport](https://developer.android.com/reference/android/support/test/uiautomator/IAutomationSupport) | Provides auxiliary support for running test cases                                                                                                                                                                                                                                        |
| [UiWatcher](https://developer.android.com/reference/android/support/test/uiautomator/UiWatcher)                   | See[registerWatcher(String, UiWatcher)](https://developer.android.com/reference/android/support/test/uiautomator/UiDevice#registerWatcher(java.lang.String, android.support.test.uiautomator.UiWatcher))on how to register a a condition watcher to be called by the automation library. |

## Classes

|-------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [By](https://developer.android.com/reference/android/support/test/uiautomator/By)                                                                     | [By](https://developer.android.com/reference/android/support/test/uiautomator/By)is a utility class which enables the creation of[BySelector](https://developer.android.com/reference/android/support/test/uiautomator/BySelector)s in a concise manner.                                                                                                                                                           |
| [BySelector](https://developer.android.com/reference/android/support/test/uiautomator/BySelector)                                                     | A[BySelector](https://developer.android.com/reference/android/support/test/uiautomator/BySelector)specifies criteria for matching UI elements during a call to[findObject(BySelector)](https://developer.android.com/reference/android/support/test/uiautomator/UiDevice#findObject(android.support.test.uiautomator.BySelector)).                                                                                 |
| [Configurator](https://developer.android.com/reference/android/support/test/uiautomator/Configurator)                                                 | Allows you to set key parameters for running uiautomator tests.                                                                                                                                                                                                                                                                                                                                                    |
| [EventCondition](https://developer.android.com/reference/android/support/test/uiautomator/EventCondition)\<R\>                                        | An[EventCondition](https://developer.android.com/reference/android/support/test/uiautomator/EventCondition)is a condition which depends on an event or series of events having occurred.                                                                                                                                                                                                                           |
| [SearchCondition](https://developer.android.com/reference/android/support/test/uiautomator/SearchCondition)\<R\>                                      | A[SearchCondition](https://developer.android.com/reference/android/support/test/uiautomator/SearchCondition)is a condition that is satisfied by searching for UI elements.                                                                                                                                                                                                                                         |
| [UiAutomatorInstrumentationTestRunner](https://developer.android.com/reference/android/support/test/uiautomator/UiAutomatorInstrumentationTestRunner) | Test runner for[UiAutomatorTestCase](https://developer.android.com/reference/android/support/test/uiautomator/UiAutomatorTestCase)s.                                                                                                                                                                                                                                                                               |
| [UiAutomatorTestCase](https://developer.android.com/reference/android/support/test/uiautomator/UiAutomatorTestCase)                                   | *This class is deprecated. It is no longer necessary to extend UiAutomatorTestCase. You can use[getInstance(Instrumentation)](https://developer.android.com/reference/android/support/test/uiautomator/UiDevice#getInstance(android.app.Instrumentation))from any test class as long as you have access to an[Instrumentation](https://developer.android.com/reference/android/app/Instrumentation.html)instance.* |
| [UiCollection](https://developer.android.com/reference/android/support/test/uiautomator/UiCollection)                                                 | 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.                                                                                                                                                                                                                                                                             |
| [UiDevice](https://developer.android.com/reference/android/support/test/uiautomator/UiDevice)                                                         | UiDevice provides access to state information about the device.                                                                                                                                                                                                                                                                                                                                                    |
| [UiObject](https://developer.android.com/reference/android/support/test/uiautomator/UiObject)                                                         | A UiObject is a representation of a view.                                                                                                                                                                                                                                                                                                                                                                          |
| [UiObject2](https://developer.android.com/reference/android/support/test/uiautomator/UiObject2)                                                       | A[UiObject2](https://developer.android.com/reference/android/support/test/uiautomator/UiObject2)represents a UI element.                                                                                                                                                                                                                                                                                           |
| [UiObject2Condition](https://developer.android.com/reference/android/support/test/uiautomator/UiObject2Condition)\<R\>                                | A[UiObject2Condition](https://developer.android.com/reference/android/support/test/uiautomator/UiObject2Condition)is a condition which is satisfied when a[UiObject2](https://developer.android.com/reference/android/support/test/uiautomator/UiObject2)is in a particular state.                                                                                                                                 |
| [UiScrollable](https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable)                                                 | UiScrollable is a[UiCollection](https://developer.android.com/reference/android/support/test/uiautomator/UiCollection)and provides support for searching for items in scrollable layout elements.                                                                                                                                                                                                                  |
| [UiSelector](https://developer.android.com/reference/android/support/test/uiautomator/UiSelector)                                                     | Specifies the elements in the layout hierarchy for tests to target, filtered by properties such as text value, content-description, class name, and state information.                                                                                                                                                                                                                                             |
| [Until](https://developer.android.com/reference/android/support/test/uiautomator/Until)                                                               | The[Until](https://developer.android.com/reference/android/support/test/uiautomator/Until)class provides factory methods for constructing common conditions.                                                                                                                                                                                                                                                       |

## Enums

|-------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------|
| [Direction](https://developer.android.com/reference/android/support/test/uiautomator/Direction) | An enumeration used to specify the primary direction of certain gestures. |

## Exceptions

|---------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [StaleObjectException](https://developer.android.com/reference/android/support/test/uiautomator/StaleObjectException)           | A[StaleObjectException](https://developer.android.com/reference/android/support/test/uiautomator/StaleObjectException)exception is thrown when a[UiObject2](https://developer.android.com/reference/android/support/test/uiautomator/UiObject2)is used after the underlying[View](https://developer.android.com/reference/android/view/View.html)has been destroyed. |
| [UiObjectNotFoundException](https://developer.android.com/reference/android/support/test/uiautomator/UiObjectNotFoundException) | Generated in test runs when a[UiSelector](https://developer.android.com/reference/android/support/test/uiautomator/UiSelector)selector could not be matched to any UI element displayed.                                                                                                                                                                             |

-

  ## Interfaces

  - [IAutomationSupport](https://developer.android.com/reference/android/support/test/uiautomator/IAutomationSupport)
  - [UiWatcher](https://developer.android.com/reference/android/support/test/uiautomator/UiWatcher)
-

  ## Classes

  - [By](https://developer.android.com/reference/android/support/test/uiautomator/By)
  - [BySelector](https://developer.android.com/reference/android/support/test/uiautomator/BySelector)
  - [Configurator](https://developer.android.com/reference/android/support/test/uiautomator/Configurator)
  - [EventCondition](https://developer.android.com/reference/android/support/test/uiautomator/EventCondition)
  - [SearchCondition](https://developer.android.com/reference/android/support/test/uiautomator/SearchCondition)
  - [UiAutomatorInstrumentationTestRunner](https://developer.android.com/reference/android/support/test/uiautomator/UiAutomatorInstrumentationTestRunner)
  - [UiAutomatorTestCase](https://developer.android.com/reference/android/support/test/uiautomator/UiAutomatorTestCase)
  - [UiCollection](https://developer.android.com/reference/android/support/test/uiautomator/UiCollection)
  - [UiDevice](https://developer.android.com/reference/android/support/test/uiautomator/UiDevice)
  - [UiObject](https://developer.android.com/reference/android/support/test/uiautomator/UiObject)
  - [UiObject2](https://developer.android.com/reference/android/support/test/uiautomator/UiObject2)
  - [UiObject2Condition](https://developer.android.com/reference/android/support/test/uiautomator/UiObject2Condition)
  - [UiScrollable](https://developer.android.com/reference/android/support/test/uiautomator/UiScrollable)
  - [UiSelector](https://developer.android.com/reference/android/support/test/uiautomator/UiSelector)
  - [Until](https://developer.android.com/reference/android/support/test/uiautomator/Until)
-

  ## Enums

  - [Direction](https://developer.android.com/reference/android/support/test/uiautomator/Direction)
-

  ## Exceptions

  - [StaleObjectException](https://developer.android.com/reference/android/support/test/uiautomator/StaleObjectException)
  - [UiObjectNotFoundException](https://developer.android.com/reference/android/support/test/uiautomator/UiObjectNotFoundException)