UI-Automator is element viewer and it is Android SDK part. It is used to view element on page and to find address of an element with the help of locator. After installing SDK Manager a batch file will be accessible from SDK. Like below screen.
After clicking on that file, UI Automator will be start and a screen will be appeared look like below screen.
To view app screen:- 1.Need to connect Android Device to computer via USB cable.
2. Enable Developer Option on connected device. // please visit on ” http://qatestingtips.com/q-how-to-enable-developer-option-in-device/”
3. Select an “App” to view screen.
To Find Element on Page:- 1. Click on Device screenshot icon as like above screen then app screen will be visible with automator viewer then see locator are there to use in script.
Syntax may be like: driver.findElement(By.id(“com.android.calculator2:id/digit5”)).click(); // try more to get more clarity.