Get Mobile Element
Command description
- Connect the mobile device before running this command.
- Retrieve a captured mobile UI element and its coordinates, dimensions, text, and attributes.
- Use Get Related Mobile Elements to retrieve its parent, children, siblings, or descendants.
Command Input Parameters
| input parameters | Input parameter type | Description |
|---|---|---|
| Mobile Device Object | Phone | Connected mobile object |
| Mobile Element | str | Captured mobile element UID, not element name, not ms-rpa-id |
| Element Wait Timeout | number | Maximum time to wait for the element to appear, in seconds. The command reports an error if the timeout expires. |
Command Output Parameters
| Output parameters | Output parameter type | Description |
|---|---|---|
| Mobile Element | PhoneElement | Retrieved element object, including coordinates, dimensions, text, and attributes |
Type definition reference
Commonly used Python expressions
| Python expression | Description |
|---|---|
phoneElement.text | The text content displayed by the element |
phoneElement.left | The distance in pixels from the left side of the element relative to the left side of the phone screen |
phoneElement.top | The distance in pixels from the top of the element relative to the top of the phone screen |
phoneElement.right | The distance in pixels from the right side of the element relative to the left side of the phone screen |
phoneElement.bottom | The distance in pixels from the bottom of the element relative to the top of the phone screen |
phoneElement.width | Element width |
phoneElement.height | Element height |
phoneElement.x_center | X coordinate of the element center, often used for clicks |
phoneElement.y_center | Y coordinate of the element center, often used for clicks |
phoneElement.x_random | Random X coordinate inside the element for a more natural click position |
phoneElement.y_random | Random Y coordinate inside the element for a more natural click position |
Operation steps
1. Start element capture
- Drag Get Mobile Element to the workspace.
- Double-click Get Mobile Element.
- Select Capture New Elements.
2. Select the target element
- Move the pointer over an element in the mirrored mobile interface.
- When the element is outlined in green, press Ctrl+left-click to capture it.
3. Verify and name the element
- Use Verify Element to confirm that the descriptor locates the intended element.
- Give the element a recognizable name.
4. View details
See the full properties of the captured element in the right panel.
tip
- Enable Developer options on the mobile device, then connect it to the computer with a USB cable. See Connect Mobile Device
- If the required element has not been captured, the AI can call the
start_capture_android_elementtool.