UiElement

šŸ’­ The UiElement class represents a UI element in a web or window application and allows for automation operations that are commonly to be performed on it.

1. Propertiesā€‹ #

  • parent: parent element, return UiElement.
  • children: child elements, return list of UiElement.
  • next_sibling: next sibling element.
  • previous_sibling: previous sibling element.

2. Methodsā€‹ #

  • childļ¼šget child element by given index.
  • clear_text: clear text of the target element.
  • clickļ¼šsingle click the target element.
  • double_clickļ¼šdouble click the target element.
  • drag_drop: hold down the left mouse button on the source element, then move to the target offset and release the mouse button.
  • get_position: get position of the target element.
  • get_property: get property value of the target element.
  • get_size: get the size(height and width) of the target element.
  • get_text: get text of the target element怂
  • highlight: highlight the target element.
  • hover: hover over the element, and the mouse will move upon the element and stay for a while.
  • mouse_downļ¼šmouse button down on the target element.
  • mouse_upļ¼šmouse button up on the target element.
  • save_to_image: save target element’s screenshot to file with the specified size and offset.
  • select_item: select one option for the target element when it is a dropdown type control.
  • select_items: select multiple options for the target element that can support multiple selections.
  • send_hotkey: send hotkey to target element.
  • set_checkbox: set check state for a checkbox control.
  • set_focus: set the target element to focused state.
  • set_text: set text for the target element.
  • wait_property: wait for the element’s value of specified property to be the same as expected
What are your feelings
Updated on 29 December 2023