Complete Appium Inspector Tutorial For Testing Mobile Apps 

Appium Inspector

Appium is one of the most renowned open-source automation testing frameworks for app testing. It supports multiple programming languages and has a handy utility called the Appium Inspector. Appium Inspector allows users to inspect the UI of a mobile app, helping them to evaluate key UI elements such as buttons, images, form fields, etc. across various Android and iOS devices. 

We will look at the capabilities and functionality of Appium Inspector in this blog and how it can help developers and testers make more efficient use of app evaluation. If you’re new to Appium, you can read our previous article on “What is Appium” to get a better understanding of Appium and its relevance in software testing.

What is Appium Inspector?

Appium Inspector is a graphical user interface (GUI) tool that is a component of the Appium framework, an open-source automation tool created especially to help with the testing and automation of mobile applications across many platforms, including Android and iOS. Appium Inspector gives testers and developers a visual depiction of the user interface (UI) elements existing in a mobile app, enabling them to interact with, examine, and test those parts’ composition and characteristics.

Users can navigate around the UI hierarchy of an app using Appium Inspector to quickly discover UI elements such as buttons, text fields, checkboxes, and more. Additionally, it has capabilities like element highlighting, which graphically shows the selected element on the app’s screen, and the capacity to provide in-depth information about each element, including its features, hierarchy, and events that user interactions may cause.

Appium Inspector architecture

Benefits of Appium Inspector:

Using Appium Inspector offers several benefits when it comes to inspecting and automating mobile applications:

  •  Support for CrossPlatforms: With Appium Inspector, you have the ability to monitor and control applications on various operating systems using a single tool, with support for iOS and Android platforms.
  •  Element Selection: You can select individual elements in the app by clicking on them in the Inspector. This will make it possible to focus on a particular element, and view its properties, attributes, or location in an element tree.
  •  Interaction with elements: the Appium Inspector is capable of interacting with elements in an application. Actions such as pressing buttons, inserting text in a text field, selecting an option from drop-down menus, or triggering events can be performed depending on the type of element. These interactions are used in tests and debugging to check the app’s behavior.
  •  View element properties: Appium Inspector will provide full information about the chosen element, including its identifier, class name, text content, position, size, and other related attributes. To learn more about the characteristics of that element, you can view these properties.
  •  Highlighting elements: By highlighting a relevant element from the mobile app, it gives visual feedback when you are interacting with an element in Appium Inspector. This makes it easier to confirm that during automation you’ve been dealing with the right element.
  •  XPath and CSS Selector Support: Appium Inspector supports XPath and CSS selectors, allowing you to use these powerful locator strategies for identifying elements during automation. It’s a convenient way of generating XPath or CSS selectors based on the chosen element.
  •  Debug test scripts: by inspecting elements and their properties, Appium Inspector can be used to debug test automation scripts. In your test script, you will be able to check if the elements are correctly identified and acted upon. You can fix or make necessary changes to your script when there’s an issue or a surprising behavior.
  •  Hierarchy Navigation: A visual representation of an app’s UI hierarchy is provided by Appium Inspector. In order to understand the relationship between elements and their parent-child connections, you can explore and navigate through different levels of hierarchy.

With these features of Appium Inspector, in the context of Test Automation or Debugging, you shall be able to gain a complete view of elements within your Mobile app by analyzing, understanding, and interacting effectively with them.

Getting Started with Appium Inspector:

However, before using Appium Inspector, you must have Appium installed on your system. Appium Inspector’s user-friendly UI interface makes it simple for developers to inspect and understand the UI elements of their mobile apps, despite the fact that it may seem complicated.

How to Set up Appium Inspector and Launch Your First Test?

Follow these steps to set up Appium Inspector:

Step 1: Install Appium: The process begins with installing Appium on your computer. At ( http://appium.io/ ), you can download the most recent version of Appium for your operating system.

Step 2: Install Appium Desktop: After installing Appium, you must install Appium Desktop, which includes Appium Inspector. You may install Appium Desktop on your PC by downloading it from the official website.

Step 3: Install Appium server: The next step prior to starting Appium Inspector is installing the Appium server. By pressing the “Start Server” button, the Appium desktop will appear. The Appium server on your computer will start up as a result.

As soon as you will click on the “Start Server” button, it will show three alternatives (ie. Simple, Advance, Present) 

  1. Simple – It uses the default values to start the server using the Host Server Address and Server Port.
aapium inpector dashboard

2. Advanced: The host server’s unique address and port can be given. The Chrome driver port address will be available for us to use when testing a Web application on Chrome.

Appium advance seetings

3. Presets: This will help us use any preset values which we have used in the Advanced tab. We are saving the new custom Host Server Address and Server Port by using the “Save As Preset” option in the Advanced tab. Then use them back by clicking on them from the Preset tab.

Screenshot of Appium application window.

Once your server is running you will see a screen similar to this. It will show the Appium version and the server host and the port address.

No alt text provided for this image

For us to start the Appium Inspector session we need to click on the magnifying glass button(🔍) on the top panel.

Step 4: Connect your device: Connect your mobile device to your computer with a USB cable. Make sure the device is in developer mode with USB debugging enabled.

The next we need to do is, to configure the application’s capabilities for testing.You should be able to add your capabilities under the Desired Capabilities tab after starting your Appium Inspector session.

Step 5: Setting up the required Capabilities: To connect your device to the Appium server, you need to specify the necessary features. Click the “New Session” Window button on the Appium desktop and enter the required capabilities for your device. On the Appium website, you can find information about the features available for your device.

Here are some commonly used desired capabilities for Appium Inspector:

  • Platform Name: Specifies the platform on which the app is being tested, such as “Android” or “iOS.”
  • Platform Version: Specifies the version of the platform, e.g., “7.0” for Android or “12.1” for iOS.
  • Device Name: Specifies the name of the device or emulator on which the app is being tested.
  • App: Specifies the path or URL to the application binary file (APK for Android or IPA for iOS).
  • App Package: For Android, specify the package name of the app under test.
  • App Activity: For Android, specify the activity name to launch the app.
  • Automation Name: Specifies the automation technology to be used, such as “Appium” or “XCUITest.”
  • Orientation: Specifies the initial screen orientation for the app, such as “PORTRAIT” or “LANDSCAPE.”
  • Browser Name: If testing a web application, specifies the browser to be used, such as “Chrome” or “Safari.”
  • UDID: Specifies the unique device identifier (UDID) of the physical device being used for testing.
  • Bundle ID: Specifies the bundle identifier of the iOS application to be tested.
  • Orientation: Specifies the initial orientation of the device, such as “portrait” or “landscape”.
  • AutoWebview: Enables or disables the automatic switching to the web context if a web view is detected.
  • AutoGrantPermissions: Specifies whether to automatically grant app permissions during installation (set to true or false).
  • NoReset: Specifies whether to reset the app state between sessions (set to true or false).

These are just a few examples of the desired capabilities that can be set in Appium Inspector. The specific capabilities required may vary depending on the testing scenario, target platform, and application being tested. It’s important to refer to the documentation and guidelines provided by the Appium project or the specific automation tool being used for a comprehensive list of available desired capabilities and their usage.

There are two different ways of adding capabilities here:

  1. By using the text boxes for capability names and mentioning the type and value.
LfUtjvObnlgSy tS75XVm Krw2vfHZyJ yW9rztvzt Ysqh15MGFmOKAYVcN0gxP7lEpty29FGN9kh3KYM9era8rhWKLwqp1tVWtEGtxgImPQX5Wk0i9 UVSFnLf2sC6xbM1nv
  1. By adding them in JSON format.
mP5yvfzJjjMSgPORepw 3z8VUC0owqEzVK2BhxBbXkkr skQBLChRlhA9Kz9L8ZSNTYxcI8zPRHUBfkuJsXGvnXpEnTXOueFCek21UNL5qYB f2gJWAEhKcdlIPew4kAVabfO1n4soMsYri8na 94

Once your capabilities are set, we need to click on the “Start Session” button. 

hBM0ErrdSA6Xn8Zq7EG jPbJIWdzplkxtUfeD Rf2yi15AdFTENai171x58p61L2WSRUSQR7EfJwkkVff4 uMLMnlk4VXDfjZJsHK87VXPOISaXFBrwuFyH XLCf5kWlKwFa1nqt1a7OGz 3CjUFwWU

And then the screen looks like the below,

No alt text provided for this image

Step 7: Use Appium Inspector: You can now use Appium Inspector to inspect content in your mobile app. You can click on any item on the screen and view its properties. By interacting with the content, you can perform actions such as clicking, scrolling, and typing.

Now you are all set, Just click on the element to get their details.

No alt text provided for this image

1st section of the screen is the screenshot of the application.    2nd section of the screen is the App Source.                            3rd section of the screen shows the Element details.

Finally, these are the steps to create an Appium tester. You can help achieve better test results by using Appium Inspector to easily automate mobile app testing.

Run Local Appium Tests On TestGrid Cloud:

You can leverage TestGrid cloud infrastructure to help you run Appium test automation over a variety of real devices. With TestGrid, you can:

  • Scale Appium test coverage across real Android and iOS devices.
  • Experience AI-based codeless automation testing.
  • Integrate with local dev environments to test before you go live.
  • Perform geolocation testing of your app.

Here is a tutorial on how to Execute Local Appium Code on Remote Device Cloud:

In addition; here is a step-by-step guide to help you run your local Appium test on the TestGrid Cloud.

Drawbacks of Appium Inspector:

Appium Inspector, despite its usefulness as a tool for inspecting and automating mobile applications, does have some limitations that users should be aware of.

  • Appium Inspector has limited support for other platforms because it primarily focuses on the Android and iOS platforms.
  • Support for non-native elements is absent.
  • Does not offer sophisticated debugging features.
  • It can have trouble recognizing and interacting with items that are constantly changing.
  • Appium inspector depends on the appium server, which could cause unexpected behaviors if the appium server has any problems.
  • It doesn’t enable real-time updates, therefore it might not accurately reflect the state of the application at any given time during automation.
  • Due to limited documentation and Community assistance, it will be difficult to find specific solutions or guidelines for using the tool effectively. 
  • Lacks built-in support for inspecting and automating desktop applications. 
  • It depends on frameworks like UI Automator or XCUITest, problems with these underlying frameworks could have a direct influence on the functioning of appium inspector.

→ Interesting Read: Selenium vs Appium

Conclusion:

The powerful tool Appium Inspector provides information about the structure and functionality of mobile applications during testing. Although it has a few flaws, like inconsistent recognition and performance problems, it has a significant benefit over these limitations. Inadequate support for replicators is among the other limitations. Appium Inspector improves test efficiency, aids in the development of automated tests, and provides an understanding of the application model. Test engineers might employ Appium Inspector’s capacity to guarantee the quality and dependability of their apps when they are aware of its limitations and search for a workable substitute

Frequently Asked Questions:

Q: Appium Inspector: What is it?

Ans: A tool included in the Appium framework is called Appium Inspector. The UI elements of mobile applications can be inspected and interacted with using a visual interface. For testing mobile apps, it aids in identifying components and creating automation scripts.

Q: What is Appium?

Ans: Appium is a popular open-source, cross-platform mobile application testing tool that allows testers or developers to write automated tests for native, hybrid, and mobile applications and offers many benefits. Appium supports testing iOS and Android apps using the same API and based on the same framework as Selenium WebDriver.

Q: What platforms is Appium Inspector compatible with?

Ans: The two most widely used mobile platforms, iOS and Android, are what Appium Inspector primarily supports. It might have limited compatibility with other platforms, though.

Q: What is Appium Inspector capable of?

Ans: With the aid of Appium Inspector, you can examine a mobile application’s UI hierarchy, recognize UI elements, view their characteristics (such as ID and class name), interact with elements (by tapping, swiping, etc.), and gather data for creating automation scripts.

Q: Real-time updates are provided by Appium Inspector?

Ans: No, the UI elements of the application are not updated in real-time by Appium Inspector. It records snapshots of the UI rather than real-time changes that occur during automation.

Q: Can I test desktop applications using Appium Inspector?

Ans: No, Appium Inspector is primarily developed for automating and testing mobile applications. It lacks integrated capabilities for automating or evaluating desktop programs.

Q: Can someone without programming skills use Appium Inspector?

Ans: Building automation scripts with Appium Inspector takes some programming experience, just like with the Appium framework. Although the tool has a visual user interface, understanding programming principles and languages like Java or Python might help you use Appium Inspector to its full potential.