Appium Inspector for Mobile App

Testsigma Inc.
12 min readApr 25, 2023

--

“Have you ever wondered how to inspect and debug the user interface of your mobile app during development? Or how to automate testing of your app with ease? Well, look no further than Appium Inspector! This powerful tool provides a user-friendly graphical interface for exploring and interacting with the UI elements of your mobile app. With Appium Inspector, you can easily identify UI elements and automate your testing process, making your app development experience much more efficient and enjoyable.

Let’s dive in and discover the wonders of Appium Inspector together!”

Introduction to Appium Inspector

Appium Inspector is a free and open-source GUI tool for mobile app developers and testers. It allows you to inspect and debug your app’s UI elements and automate your testing process. It is part of the Appium mobile automation framework and is available for Windows, Mac, and Linux operating systems. With its intuitive interface and powerful capabilities, Appium Inspector is an essential tool for any developer looking to create a high-quality mobile app.

Why Choose Appium Inspector?

If you’re a tester or a developer who’s tired of manually identifying and testing UI elements of your mobile app, Appium Inspector is the tool for you. Here are a few reasons why:

  • Get a comprehensive view of your app’s UI hierarchy: Appium Inspector lets you view the complete hierarchy of your app’s UI elements, which helps testers and developers understand how to align certain UI elements and identify different fragments or layers within the app.
  • Easily find and manage attributes of UI elements: With Appium Inspector, you can easily find and manage attributes like the name, value, and description of UI elements. You can also generate XPath locators for these elements, which makes it easy to use them in your automation scripts.
  • Record and playback manual app actions: Appium Inspector makes it easy to record and playback manual app actions, which lets you access the hierarchy and elements of your app and create clear test scripts for your app.
  • Supports a wide range of platforms: Appium Inspector supports a wide range of platforms, including iOS, Android, and Windows, which makes it a versatile tool for developers and testers.

In conclusion, if you’re looking for a user-friendly and open-source tool that helps you identify and interact with UI elements of your mobile app, Appium Inspector is the way to go. It’s versatile, easy to use, and supports a wide range of platforms, making it a great choice for developers and testers alike.

Benefits of Appium Inspector

Ready to take your mobile app testing to the next level? Let’s take a look at the benefits of using Appium Inspector:

  • No need to install Appium software: With Appium Inspector, you don’t need to install the entire Appium Desktop software. This saves you time and resources as a whole.
  • Access devices remotely: Appium Inspector makes it easy to perform tests on real mobile devices. This is important for app testing scenarios, and it means you can easily write mobile test scripts with Appium Inspector.
  • Obtain web objects: Appium Inspector can help testers identify objects quickly when they write Appium test scripts. It can also support additional content and app types that are not supported by Appium Desktop, such as hybrid apps.
  • No need for built-in Appium server and inspector: When using emulators or simulators, you don’t need to use a built-in Appium server and inspector. Instead, you can switch to real devices to write and run Appium test scripts.

Specifications of Appium Desktop Inspector

To run Appium Desktop Inspector, you’ll need:

  • A running Appium server that can be accessed through the network via the Inspector
  • Every Appium driver, plugin, tool, and other necessities you might come across
  • An IDE for writing and executing test scripts, such as Visual Studio Code, Eclipse, or IntelliJ IDEA

To test Android apps using Appium Desktop Inspector, you’ll need:

  • A desktop or PC with macOS X 10.7 or Windows 10 or later versions
  • Java SE version 8 or advanced versions, Java Development Kit (JDK)
  • A simulator or an Android device
  • Node and npm (Version 10 and above)
  • Integrated development environment (IDE)
  • An emulator or an Android device
  • Appium or Appium Desktop

To test iOS apps using Appium Desktop Inspector, you’ll need:

  • A PC with macOS X 10.7 or above versions
  • Xcode- latest version
  • Homebrew
  • Integrated development environment (IDE)
  • Java SE version 8 or Java Development Kit (JDK)
  • Node and npm (Version 10 and above)
  • A simulator or an iOS device
  • Paid, active Apple developer account when you run Appium on a real iOS device
  • Appium or Appium Desktop.

Getting started with Appium Inspector

Appium Inspector is a tool that allows developers and testers to interactively inspect the user interface (UI) of mobile apps, both Android and iOS, and obtain elements’ properties to be used in test scripts. With Appium Inspector, you can quickly and easily create tests without needing to write any code.

Here are some pointers about getting started with Appium Inspector:

  1. Install Appium Desktop: Before starting with Appium Inspector, you need to install Appium Desktop on your machine. Appium Desktop provides a graphical interface that makes it easier to use Appium, including the Inspector tool.
  2. Connect your device: Once you have Appium Desktop installed, you need to connect your Android or iOS device to your machine. Make sure the device is set up for developer mode, debugging mode, and USB debugging.
  3. Start a new session: To start a new session with Appium Inspector, you need to launch Appium Desktop and click on the “Start Inspector Session” button. This will open a new window that shows a live view of your device’s screen.
  4. Inspect elements: With the live view open, you can now interact with your app on the device and inspect the UI elements. You can click on elements to view their properties, such as their ID, class name, text, and location.
  5. Use the Appium Inspector interface: Appium Inspector provides a simple interface for inspecting and selecting UI elements. You can use the Inspector interface to locate and select elements on the screen and copy their properties for use in your test scripts.
  6. Export the test script: Once you have inspected the UI elements and obtained their properties, you can export the test script to your preferred programming languages, such as Java, Python, or Ruby.

Here is a GitHub link for you to get and learn more about the Appium inspector.

When you use Appium Inspector, you’re requesting the Appium server to provide a set of commands to interact with the mobile app. The Inspector then identifies the mobile app elements that are included in those commands using a set of attributes. These elements are identified before the commands are sent to the target system. Once the Inspector has identified the elements, you’ll be able to perform the action you had intended, such as clicking a button or entering text in a field.

Given below is the core architecture of the Appium request flow, which explains the structure better.

Element inspector tools to identify mobile app elements

There are several element inspector tools available that can help identify mobile app elements, including:

  • Appium Desktop Inspector: A built-in tool within the Appium Desktop app, allowing you to interactively inspect the UI of your mobile app and obtain element properties.
  • UI Automator Viewer: This tool is available for Android, which allows you to inspect the layout hierarchy and view the properties of the elements in an Android app.
  • Xcode Accessibility Inspector: This tool is available for iOS and is used to inspect the hierarchy and attributes of the elements in an iOS app.
  • Selendroid Inspector: A built-in tool in the Selendroid server that allows you to interactively inspect the UI of your Android app and obtain element properties.

However, the top most inspectors that are used are Appium Desktop Inspector and UI Automator Viewer.

How to use UIAutomatorViewer?

UIAutomatorViewer is a tool that helps you inspect the UI elements of an Android application. It can help you find locators and create tests for your app.

  • Install Android SDK: UIAutomatorViewer is part of the Android SDK, so you need to install it first. You can download the SDK from the Android Developer website.
  • Set up environment variables: Once you’ve downloaded the Android SDK, you need to set up some environment variables so that Appium can access it. You can find detailed instructions on how to set up the variables on the Appium website.
  • Launch UIAutomatorViewer: To launch UIAutomatorViewer, navigate to the “tools” folder in the Android SDK and find the “uiautomatorviewer” executable. Double-click on it to launch the tool.
  • Connect your device: To inspect the elements in your app, you need to connect an Android device to your computer via USB. Make sure that USB debugging is enabled on the device.
  • Capture the screen: Once your device is connected, you need to capture a screenshot of your app’s UI. You can do this by clicking on the “Device Screenshot” button in UIAutomatorViewer.
  • Inspect the elements: After capturing the screenshot, you can use UIAutomatorViewer to inspect the elements in your app. You can see the layout hierarchy, and view the properties, and attributes of each element by clicking on it.

If you need a detailed version, learn more here.

Inspect mobile app using UI Automator Viewer

In short, to inspect your mobile app using UI Automator Viewer, you need to:

  • Connect your Android device to your PC via a USB cable and make sure it is unlocked12
  • Open the app that you want to inspect on your device12
  • Open the command prompt and enter uiautomatorviewer2
  • Click the Device Screenshot button on the UIAutomatorViewer interface12
  • Hover over the snapshot in the left-hand panel to see the UI elements identified by UIAutomatorViewer3

You can also use Appium Desktop Inspector or Appium Inspector for both Android and iOS apps.

How does an Appium Inspector perform?

Appium Desktop Inspector uses methods similar to UIAutomatorViewer to identify mobile app elements, such as:

  • Appium Inspector works by communicating with the Appium server, which in turn communicates with the mobile device or emulator being tested.
  • When a client requests a set of commands from the Appium server, the Inspector identifies the mobile app elements involved and uses a set of attributes to identify the elements.
  • Once the Inspector has identified the elements, the user can interact with them through the Inspector to perform various actions, such as clicking a button or filling out a form.
  • The Inspector can also obtain properties of the elements, such as their ID, name, class, and location, which can be used to create automated tests.
  • By providing an easy-to-use interface for interacting with mobile app elements and obtaining their properties, the Appium Inspector simplifies the process of creating automated tests and improves the efficiency of the testing process.

How to use Appium Inspector on Cloud?

When using Appium Inspector on Cloud, the Appium server and the app being tested are running on a remote cloud server instead of on a local device. This allows for testing on a variety of devices and operating systems without the need for physical devices.

To use Appium Inspector on Cloud, follow these steps:

  • Choose a cloud-based service provider, such as Sauce Labs, AWS Device Farm, or BrowserStack.
  • Create an account on the cloud-based service provider’s website and set up your project.
  • Upload your mobile app to the cloud-based service provider’s testing environment.
  • Configure your Appium test script to connect to the cloud-based service provider’s Appium server and use the device or operating system you want to test on.
  • Launch Appium Inspector on Cloud and use it to interactively inspect the UI of your mobile app and obtain element properties.
  • By using Appium Inspector on Cloud, you can save time and resources by testing your mobile app on a wide variety of devices and operating systems without needing to physically acquire and maintain those devices.

How to use Appium Inspector for app testing?

Before diving into how to use Appium Inspector, it’s important to understand the difference between Appium Inspector and UIAutomatorViewer. While UIAutomatorViewer is an Android-specific tool for inspecting UI elements and identifying their properties, Appium Inspector is a more versatile tool that works with both Android and iOS apps and can be used for automated testing. Now, let’s look at how to use Appium Inspector for app testing.

  1. Uploading Your Application: Start by uploading the application you want to test to the cloud device provider of your choice.
  2. Setting the Capabilities: Next, set the desired capabilities, such as the app path and device name, to define the environment for your test.
  3. Starting an Appium Inspector Session: Once the capabilities are set, you can start an Appium Inspector session. This will allow you to interactively inspect the UI of your app and obtain element properties.
  4. Configuring Your Credentials: If required, configure your credentials to access the cloud device provider.
  5. Configuring the Required Capabilities and Starting the Session: Configure any additional capabilities that may be required, such as the device platform and version, and then start the Appium Inspector session.
  6. Inspect UI Elements Using Appium Desktop Inspector: Once the session has started, you can use the Appium Desktop Inspector to inspect UI elements and their properties. This information can then be used to create automated tests using Appium.

By following these steps, you can use Appium Inspector to create effective automated tests for your mobile app.

Limitations of Appium Inspector

Like any other tool, Appium Inspector has its own cons, and some of them are -

  1. Limited to mobile apps: Appium Inspector is designed specifically for inspecting and testing mobile apps. It cannot be used for inspecting or testing other types of software applications, such as web applications or desktop applications.
  2. Dependency on app context: Appium Inspector relies heavily on the context of the mobile app being tested. As a result, it may not be able to identify all UI elements if the app context changes or if the app has dynamic content that is not visible at the time of testing.
  3. Inability to handle custom controls: Appium Inspector may not be able to handle custom controls that are not recognized by the underlying automation framework. This can limit its ability to test some mobile apps effectively.
  4. Limited support for gesture testing: While Appium Inspector supports basic interaction with UI elements such as clicking and typing, it has limited support for gesture-based testing, such as swiping, pinching, or zooming.
  5. Limited support for image-based testing: Appium Inspector does not support image-based testing, which means it cannot verify the appearance or location of UI elements based on their visual appearance or location on the screen.

Now, with these disadvantages, here is how Testsigma can help you -

  1. Multi-platform support: TestSigma can be used to test applications across multiple platforms, including web, desktop, and mobile. This means that you can use TestSigma to test your mobile application on both Android and iOS, providing a more comprehensive testing solution.
  2. No-code automation: TestSigma’s no-code automation approach makes it easy for non-technical team members, such as business analysts and quality assurance professionals, to create and execute automated tests without requiring any programming skills.
  3. Built-in test management: TestSigma comes with built-in test management features that allow you to manage your test cases, track defects, and generate reports in a centralized location.
  4. Faster test execution: TestSigma’s cloud-based infrastructure allows for parallel execution of test cases, which can significantly reduce test execution time and speed up the testing process.
  5. Intelligent test maintenance: TestSigma’s AI-powered maintenance feature can automatically update your test scripts to reflect changes in the application under test, reducing the amount of time and effort required to maintain your test suite.

In short, Testsigma can help streamline the testing process, reduce the time and effort required to create and maintain test cases, and provide a more comprehensive testing solution for your mobile applications.

Conclusion

In conclusion, mobile app testing is an important part of the app development process, and Appium Inspector is a valuable tool for both developers and testers. It allows users to easily inspect the UI of mobile apps and obtain element properties for use in test scripts. While Appium Inspector has its limitations, it is a great starting point for those new to mobile app testing. For those looking for a more comprehensive solution, TestSigma is a cloud-based platform that provides automated testing for mobile and web applications, helping teams save time and resources.

FAQs

Can Appium Inspector run on Windows?

Yes, Appium Inspector can run on Windows. Appium is a cross-platform automation framework that can be used on Windows, Mac, and Linux. To use Appium Inspector on Windows, you need to download and install Appium Desktop for Windows, and then launch the Appium Inspector tool from within the app.

How do I connect my Appium inspector to the Appium server?

To connect Appium Inspector to the Appium server, you need to specify the server’s IP address and port number in the inspector’s desired capabilities. Once you have entered the correct details, you can start the Appium Inspector session and interact with the UI elements of your mobile app. This will allow you to easily test and debug your app using Appium.

How to use Appium Inspector for Android?

To use Appium Inspector for Android, you need to have Appium Desktop and Android SDK installed on your computer. Once you have installed these tools, you can launch Appium Desktop and start a new session. Next, you need to upload your Android application and set the required capabilities. Finally, you can start an Appium Inspector session and inspect the UI elements of your Android application for testing and automation.

--

--

Testsigma Inc.
Testsigma Inc.

Written by Testsigma Inc.

Testsigma is a completely cloud-based codeless test automation tool that lets you create stable and reliable tests for web, mobile & APIs — all from one place.

No responses yet