The uiautomator testing framework lets you test your user interface (UI) efficiently by creating automated functional UI testcases that can be run against your app on one or more devices.
The UI Automator testing framework is included in the Android SDK. UI Automator lets you test the user interface (UI) of Android apps efficiently by creating automated functional UI test cases that can be run against your app on one or more devices. Because it interacts with GUI elements of Android apps it can be used to test most apps, including pre-installed system apps such as Settings; and third-party apps.
In addition to unit testing the individual components that make up your Android application (such as activities, services, and content providers), it is also important that you test the behavior of your application’s user interface (UI) when it is running on a device. UI testing ensures that your application returns the correct UI output in response to a sequence of user actions on a device, such as entering keyboard input or pressing toolbars, menus, dialogs, images, and other UI controls.