A view tree (also known as a UI hierarchy or DOM tree) is a structured representation of all the visual elements currently displayed on an Android device's screen. It is the foundation for how MoreLogin RPA locates and interacts with on-screen elements.
When an Android app renders its UI, the system creates a hierarchical tree of View objects. Each node in this tree represents a UI element — buttons, text fields, images, containers, etc.
FrameLayout
├── LinearLayout
│ ├── TextView ("Welcome")
│ └── EditText (input field)
├── RecyclerView
│ ├── ViewHolder[0]
│ │ ├── ImageView (app icon)
│ │ └── TextView ("Chrome")
│ └── ViewHolder[1]
│ ├── ImageView (app icon)
│ └── TextView ("Gmail")
└── FrameLayout
└── Button ("OK")MoreLogin RPA uses the Android Accessibility Service to capture this tree, converting it into a JSON structure that your workflow can query.
Each element in the view tree exposes these key properties:
| Property | Type | Description | Example |
|---|---|---|---|
text | String | Visible text displayed by the element | "Chrome" |
resourceId | String | Android resource ID (also called fullId) | "com.android.launcher3:id/icon" |
className | String | Android view class name | "android.widget.TextView" |
contentDescription | String | Accessibility description (used for screen readers) | "Chrome" |
packageName | String | Package name of the app owning this element | "com.android.launcher3" |
bounds | Object | Screen coordinates {top, right, bottom, left} | {"top":261,"right":540,...} |
centerX / centerY | Integer | Center point coordinates of the element | 405, 441 |
isClickable | Boolean | Whether the element responds to tap events | true |
isEnabled | Boolean | Whether the element is interactive | true |
isVisibleToUser | Boolean | Whether the element is currently visible on screen | true |
childCount | Integer | Number of child elements | 0 |
index | Integer | Position index among sibling elements | 2 |
The Find Element node queries the view tree using filter conditions:
| Filter Condition | Description | Example |
|---|---|---|
text | Match by visible text | text Equals "Chrome" |
fullId | Match by resource ID | fullId Equals "com.android.launcher3:id/icon" |
class | Match by view class | class Equals "android.widget.Button" |
desc | Match by content description | desc Contains "Search" |
Once an element is found, you can:
- Tap it — using the Tap Element node
- Extract data — using the Run JS Script node to read properties like
textorcontentDescription - Loop over multiple elements — using the Loop node to iterate through a list of found elements
Use the Developer Tools in MoreLogin RPA to inspect the view tree of any cloud phone screen in real time:
- Open the cloud phone in MoreLogin
- Go to RPA → Developer Tools
- The view tree panel shows all elements on the current screen
- Click any element to see its properties (text, resourceId, bounds, etc.)
For more about Developer Tools, see Developer Tools.
- Use
resourceIdfor stable matching: Text content may change across languages or app updates, butresourceIdvalues are usually stable. - Combine multiple conditions: Use
text+classtogether whenresourceIdis not available. - Check
isVisibleToUser: Elements may exist in the tree but be off-screen. The Find Element node only returns visible elements by default. - Wait for elements: Screens may take time to load. Use the Maximum Wait Time parameter in Find Element to poll until the element appears.