pywinauto.element_info

Interface for classes which should deal with different backend elements

class pywinauto.element_info.ElementInfo

Abstract wrapper for an element

children(**kwargs)

Return children of the element

class_name

Return the class name of the element

control_id

Return the ID of the control

descendants(**kwargs)

Return descendants of the element

dump_window()

Dump an element to a set of properties

enabled

Return True if the element is enabled

static filter_with_depth(elements, root, depth)

Return filtered elements with particular depth level relative to the root

framework_id

Return the framework of the element

get_descendants_with_depth(depth=None, **kwargs)

Return a list of all descendant children of the element with the specified depth

handle

Return the handle of the element

has_depth(root, depth)

Return True if element has particular depth level relative to the root

iter_children(**kwargs)

Iterate over children of element

iter_descendants(**kwargs)

Iterate over descendants of the element

name

Return the name of the element

parent

Return the parent of the element

process_id

Return the ID of process that controls this element

rectangle

Return rectangle of element

rich_text

Return the text of the element

set_cache_strategy(cached)

Set a cache strategy for frequently used attributes of the element

top_level_parent

Return the top level window of this element

The TopLevel parent is different from the parent in that the parent is the element that owns this element - but it may not be a dialog/main window. For example most Comboboxes have an Edit. The ComboBox is the parent of the Edit control.

This will always return a valid window element (if the control has no top level parent then the control itself is returned - as it is a top level window already!)

visible

Return True if the element is visible