Skip to main content

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 parametersInput parameter typeDescription
Mobile Device ObjectPhoneConnected mobile object
Mobile ElementstrCaptured mobile element UID, not element name, not ms-rpa-id
Element Wait TimeoutnumberMaximum time to wait for the element to appear, in seconds. The command reports an error if the timeout expires.

Command Output Parameters

Output parametersOutput parameter typeDescription
Mobile ElementPhoneElementRetrieved element object, including coordinates, dimensions, text, and attributes

Type definition reference

Commonly used Python expressions

Python expressionDescription
phoneElement.textThe text content displayed by the element
phoneElement.leftThe distance in pixels from the left side of the element relative to the left side of the phone screen
phoneElement.topThe distance in pixels from the top of the element relative to the top of the phone screen
phoneElement.rightThe distance in pixels from the right side of the element relative to the left side of the phone screen
phoneElement.bottomThe distance in pixels from the bottom of the element relative to the top of the phone screen
phoneElement.widthElement width
phoneElement.heightElement height
phoneElement.x_centerX coordinate of the element center, often used for clicks
phoneElement.y_centerY coordinate of the element center, often used for clicks
phoneElement.x_randomRandom X coordinate inside the element for a more natural click position
phoneElement.y_randomRandom 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_element tool.

FAQ

See Mobile Automation FAQ