Book Image

Appium Essentials

Book Image

Appium Essentials

Overview of this book

Table of Contents (14 chapters)

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:

  1. Open the Android emulator or real device (For a real device, we need to enable USB debugging).

  2. Open the calculator app.

  3. Now, click on the device's screenshot icon from the UI Automator Viewer window (The progress information box will be visible.). If more than one device...