Appium Inspector and its Features
In this article, we will go through some of Appium inspector's features.
Let us go over some basic tools to use Appium:
This icon represents the ‘Select Elements’ tool, which does as it is named. It is selected by default and is the tool which will be used most.
In the above screenshot, we have selected the Age input, which is colored in purple now. Then, in the middle App Source section, the tag of the locator is highlighted in blue, and the details of the selected element are displayed on the right under the Selected Elements column. We will use this column extensively.
This icon represents the ‘Swipe by Coordinates’ tool, which can be used to swipe across the screen. Once you select this and hover on the app display, on the top left the coordinates (pixels) are displayed.
This icon represents the ‘Tap by Coordinates’ tool, which combines the functionality of above two tools, with the added ability to tap while selecting an element (this does not swipe). This tool also displays coordinates.
Once you have selected an element, on the right column, you will get a list of attributes available for the element.
Few more tools are available after selecting an element.
Tap tool – will emulate tapping on the element. (Similar to ‘Tap by Coordinates’)
Send Keys – used to enter text into the element, if applicable. Clicking on this will bring up an input box in which text can be entered.
Clear – used to remove any text that is present in the input field.
Copy Attributes – copy the attributes listed below in JSON format.
Get Timing – lists the session time of the element in milliseconds.
As you can see in the above screenshot, there are multiple attributes listed, such as id, xpath, class, text, etc. The attributes you see for the Age input in the HICC app may or may not be seen in the apps you intend to automate because these are dependent on how the apps are built.
These attributes can be used as locators to in automation. For more details, check out these articles.
How to check validity of a locator:
If you would like to check if a locator is finding the exact element you want, you can check using the Search for the element button, found in the top-most navigation bar. You can click on the magnifying glass button which will bring up an input box. Please select the required Locator Strategy. Let us search for an ID. Once strategy is selected, enter the id value:
After searching, you will find the results and you can click on each result to check for the element(s) getting highlighted.
Some more features:
Commands
Commands section contains a group of app-specific actions that you normally cannot perform manually, such as manipulating the mobile keyboard, pressing certain keys, etc. There are four main groups: Device, Session, Web and Context. You can click on each of these to see their subgroups.
You can now select one of the subgroups to show all possible actions for that group.
As mentioned earlier, these commands are to perform actions that you otherwise cannot in a simulation of a mobile app that will be used on real phones. You can check if the app functions well virtually too with the help of these.
Actions
Session Information
As is clear form the name, all details available for the current Appium session are listed here. In the below screenshot, BrowserStack specific details are listed since this particular session was launched on BrowserStack cloud. These will vary depending on the cloud provider and device chosen. These details can be shared with developers for any debugging purposes.