What I explain for my system (Windows 7), but my explanations should be easily translated to other systems.
Background
- When you want to test for Android automation, you should always install the Android SDK, so I assume you already did this. Allows you to call the path to the sdk folder
<ANDROID_HOME> (including the sdk folder) - Run
<ANDROID_HOME>/SDK Manager.exe . Select the latest version of Android SDK Tools and Android SDK Platform-tools and install them. - Connect the device you want to check:
- Or run the emulator - it automatically connects to your system.
- Or connect a physical device and install the appropriate USB drivers. You cna make sure that the device is connected to the command
<ANDROID_HOME/platform-tools/adb.exe devices - if there is at least one device in the list.
Once you have it all:
Run <ANDROID_HOME>/tools/uiautomatorviewer.bat . this will open a screen that allows you to take screenshots of the condensed device. See below image:

The picture was taken with the button under the purple rectangle, which I added artificially. Red is added by the tool because I find an element of interest. You can see the properties of the elements on the right. These are usually the properties that you used to test your own application.
If you want to test elements loaded in WebView , then it would be better to use Chrome remote debugging to get the correct selectors.
Footnote:
As I can see, you are taking the first steps in testing mobile automation systems, and this is a very interesting area, I can offer you a look at the ATMOSPHERE Android Test Automation System. Disclaimer: I am one of its creators. Nevertheless - it is freely available and open. We also believe that it provides features that are not supported in other frameworks and that they are easy to get started, so I hope it will be useful for you!
source share