qa-testing

Mastering Appium Inspector: Element Selection and UI Interaction

Appium Tutorial: Using Inspector

In the last lesson, we covered Appium installation, device connection, execution, and launching the Inspector.

This time, we will use the Inspector to find UI elements and send commands from the Inspector to the device.


1. Selecting an Element

Appium Inspector Selection Mode

The arrow icon on the left is the default "Select Elements" mode.

First, what is an element? You can think of it as the various components visible on the screen, including UI components. The goal of Appium is to find these elements and control them.

With "Select Elements" active, move your mouse cursor around the device screen section on the left side of the Inspector. You will notice the currently recognized elements being highlighted in yellow.

Let's try clicking on the first item, "Accessibility."

Selected Accessibility Element

The area highlighted in blue indicates the element selected in the Inspector. On the far right, you can see the detailed information for the "Selected Element."


2. Using the "Tap" Action on a Selected Element

Once an element is selected, let's make it perform an action. This is done by sending a "Command" to the selected element. Several options are available; let's try "Tap." This simulates a light finger tap on the screen. Click on "Tap."

Tapping an Element

We have now entered a detailed sub-menu. While this specific app behaves this way, actions may vary depending on the app and how it was developed. When performing actual automation, it is best to test the behavior manually and then handle the subsequent actions accordingly.


3. Returning After a Tap Action

To go back to the previous screen on Android, you usually press the physical Back button (HW back key). You can do the same here. Click the "<- Back" key in the top menu. You will see the screen return to the initial list.


4. Using "Send Keys" and "Clear"

Now, navigate through Content -> Clipboard -> Data Types using the Tap button. If you operated the phone manually, the phone screen and the Inspector screen might be out of sync. In this case, click the "Refresh Source" button in the upper right to sync them. Next, Tap the area at the bottom of the screen.

Selecting Input Field

This is the area below "No data in clipboard." Is the blue area activated as shown in the photo? On the actual phone, is the cursor blinking? This is an area where users can enter text. On a real device, touching this would bring up the keyboard.

Look at the Inspector again. While touching is done with "Tap," what about areas requiring keyboard input, like an ID field? This is where "Send Keys" under the Selected Element section comes in. Click "Send Keys" and try entering some text. Let's try "Entering with Appium."

Using Send Keys

Text Entered on Device

Wow, it enters the text much easier than expected!

Now, let's delete the entered value. You can use the "Clear" button next to it to remove the text. Give it a try. It’s cleared perfectly. With Tap, keyboard input, and the Back key, you can handle most basic operations.


In the next session, we will look into Recording and converting actions into Scripts.