Test Uiautomator

  
Framework for cross app functional UI testing
Latest Update Stable Release Release Candidate Beta Release Alpha Release
September 7, 2022 - - - 2.3.0-alpha01

Declaring dependencies

To add a dependency on test, you must add the Google Maven repository to your project. Read Google's Maven repository for more information.

Add the dependencies for the artifacts you need in the build.gradle file for your app or module:

Groovy

dependencies {
    // Use to implement UIAutomator tests
    androidTestImplementation "androidx.test.uiautomator:uiautomator:2.3.0-alpha01"
}

Kotlin

dependencies {
    // Use to implement UIAutomator tests
    androidTestImplementation("androidx.test.uiautomator:uiautomator:2.3.0-alpha01")
}

For more information about dependencies, see Add build dependencies.

Feedback

Your feedback helps make Jetpack better. Let us know if you discover new issues or have ideas for improving this library. Please take a look at the existing issues in this library before you create a new one. You can add your vote to an existing issue by clicking the star button.

Create a new issue

See the Issue Tracker documentation for more information.

Version 2.3.0

Version 2.3.0-alpha01

September 7, 2022

androidx.test.uiautomator:uiautomator:2.3.0-alpha01 is released. Version 2.3.0-alpha01 contains these commits.

API Changes

  • Annotated the nullness of all public methods.
  • Switched MotionEvent injection to asynchronous with a short delay for smoother UiObject2 gestures.
  • Reduced the polling interval while waiting from 1000ms to 100ms.
  • Updated UiDevice#wakeUp and UiDevice#sleep to use KEYCODE_WAKEUP and KEYCODE_SLEEP to support devices that override the power button.
  • Added UiObject2#getDisplayId and support for finding and managing objects across multiple displays.
  • Added UiObject#click and UiObject2#clickAndWait methods for clicking on a point using its coordinates.

Bug Fixes

  • Fixed an issue where the display size calculations were occasionally incorrect and might ignore portions of the screen, especially in multi-window mode (Ifc016c).
  • Fixed the scaling of screenshots in UiDevice#takeScreenshot (Id80ad6).
  • Improved the reliability of Until.scrollFinished and UiObject2#scroll (I7b0595).
  • Fixed strict mode IncorrectContextUseViolation warnings (Iffa6a0).