Finding elements for native and hybrid apps
There are multiple ways to find an element for native and hybrid apps, such as UIAutomatorviewer (for Android only) and Appium Inspector (for both Android and iOS). Let's start with the uiautomator.
Finding elements with UIAutomatorviewer
We can find the UIAutomatorviewer in the Android SDK folder C:\android-sdk\tools
(assuming that the SDK located in the C drive); you can find the same in Mac as well under the tools
folder, as shown in the following screenshot:

To open uiautomatorviewer
, you need to double-click on it. You will get the following screen:

Now, we are going to take an example of finding an element of the Android app calculator. We need to perform the following steps:
- Open the Android emulator or real device (For a real device, we need to enable USB debugging).
- Open the calculator app.
-
Now, click on the device's screenshot icon
from the UI Automator Viewer window (The progress information box will be visible.). If more than...