Source Tab
The Source tab is the default tab opened after starting an Inspector session. It can be divided into two connected parts: the Application Source panel, and the Selected Element panel.
The divider line in the middle of the tab can be used to adjust the widths of both halves of this tab, as well as collapse/expand them.
Application Source¶
The Application Source is the central panel of the Source Tab, and shows the application source XML in a tree-like structure.
The panel can be divided into 3 parts: header buttons, source actions, and the source tree.
Source Header Buttons¶
Icon | Description |
---|---|
![]() |
Copy the application XML to the clipboard |
![]() |
Download the source as an .xml file |
Source Action Buttons¶
Icon | Description |
---|---|
![]() |
Collapse all nodes in the source tree |
![]() |
Toggle all non-'important' element attributes |
![]() |
Perform a plaintext search in the source XML |
Source Tree¶
The application source tree is generated from the XML data returned by the Appium driver. By default,
the tree only shows the class name for each element entry, along with several 'important' attributes
such as value
and content-desc
. All non-'important' attributes are hidden by default for ease of
navigation, but can be revealed with the Toggle Attributes button.
All elements in the XML tree are interactable, and clicking on one causes 3 actions:
- The element entry in the XML tree is highlighted
- The element highlighter appears in the Screenshot panel (if Element Mode is selected)
- The element details are shown in the Selected Element panel
Elements that have one or more child elements have an arrow on their left side, which can be clicked to toggle visibility of such child elements.
For supported Appium drivers, the maximum depth of the returned XML tree can be adjusted with the
snapshotMaxDepth
setting.
Refreshing the Source¶
By default, the source XML is only updated when a refresh is requested. This can happen when:
- interacting with an element (tap/send keys/clear)
- interacting with the screenshot (tap/swipe)
- simulating system actions
- executing driver commands (depends on the command)
- executing custom gestures
- pressing the Refresh button
Note that interacting with the application outside of the Inspector will not cause the source XML to refresh.
The use of MJPEG session capabilities (such as appium:mjpegServerPort
) allows to modify this
behavior. While the default source refresh behavior in MJPEG mode stays the same, the mode adds the
automatic source refresh button in the application
header, which allows to disable automatic refreshing.
Selected Element¶
The Selected Element panel is shown on the right side of the Source tab. It is empty by default, but becomes populated once an element is selected.
In order to populate the panel, an element can be selected in one of the following ways:
- Selecting an entry in the Application Source
- Selecting a highlighter in the Screenshot panel
- Clicking the Reveal Element in Source button in the Search Results
The panel can be divided into 4 parts: header buttons, element action buttons, suggested locators, and element attributes.
Element Header Buttons¶
Icon | Description |
---|---|
![]() |
Copy the element attributes to the clipboard as an array of JSON objects |
![]() |
Download a screenshot of the element as a .PNG file |
Element Action Buttons¶
Icon | Description |
---|---|
![]() |
Tap the element |
![]() |
Enter text to send to the element, or clear its text |
![]() |
Run a timing comparison for the suggested element locators |
Suggested Locators¶
This table lists one or more locator strategies + selectors that can be used to find the element. Clicking on a selector copies it to the clipboard.
Pressing the timing comparison button executes a search for each of the listed strategies + locators, and adds a new table column with the elapsed time until the element was returned.
Element Attributes¶
This table lists all attributes retrieved from the element, along with their values. Clicking on a value copies it to the clipboard.
Refer to your Appium driver documentation for ways to customize the attributes shown in this table.