Android UIAutomator with Kotlin

UIAutomator it’s similar to Espresso, but with UIAutomator you can automate tests outside and inside of the app. The code below shows how to do clicks and scroll on Android device settings. The test opens the device settings and clicks to reset the Google advertising ID. Look at the demo video at the bottom.

  1. Add the “UIAutomator” Gradle dependency in your file build.gradle.
dependencies {
...
androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'
}

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store