Quite a few contorls have other text that is visible, for example Edit controls usually have an empty string for window_text but still have text displayed in the edit window.
- windowclasses= []
- writable_props
Build the list of the default properties to be written.
Derived classes may override or extend this list depending on how much control they need.
- rectangle()
Return the rectangle of element: {"top", "left", "right", "bottom"}
The rectangle() is the rectangle of the element on the screen. Coordinates are given from the top left of the screen.
This method returns a RECT structure, Which has attributes - top, left, right, bottom. and has methods width() and height(). See win32structures.RECT for more information.
button The mouse button to click. One of ‘left’, ‘right’, ‘middle’ or ‘x’ (Default: ‘left’, ‘move’ is a special case)
coords The coordinates to click at.(Default: the center of the control)
double Whether to perform a double click or not (Default: False)
wheel_dist The distance to move the mouse wheel (default: 0)
NOTES:
This is different from click method in that it requires the control to be visible on the screen but performs a more realistic ‘click’ simulation.
This method is also vulnerable if the mouse is moved by the user as that could easily move the mouse off the control before the click_input has finished.
colour can be either an integer or one of ‘red’, ‘green’, ‘blue’ (default ‘green’)
thickness thickness of rectangle (default 2)
fill how to fill in the rectangle (default BS_NULL)
rect the coordinates of the rectangle to draw (defaults to the rectangle of the control)
- element_info
Read-only property to get ElementInfo object
- from_point(x, y)
Get wrapper object for element at specified screen coordinates (x, y)
- get_properties()
Return the properties of the control as a dictionary.
- is_child(parent)
Return True if this element is a child of ‘parent’.
An element is a child of another element when it is a direct of the other element. An element is a direct descendant of a given element if the parent element is the the chain of parent elements for the child element.
- is_dialog()
Return True if the control is a top level window
- is_enabled()
Whether the element is enabled or not
Checks that both the top level parent (probably dialog) that owns this element and the element itself are both enabled.
If you want to wait for an element to become enabled (or wait for it to become disabled) use Application.wait('visible') or Application.wait_not('visible').
If you want to raise an exception immediately if an element is not enabled then you can use the BaseWrapper.verify_enabled(). BaseWrapper.VerifyReady() raises if the window is not both visible and enabled.
- is_visible()
Whether the element is visible or not
Checks that both the top level parent (probably dialog) that owns this element and the element itself are both visible.
If you want to wait for an element to become visible (or wait for it to become hidden) use Application.wait('visible') or Application.wait_not('visible').
If you want to raise an exception immediately if an element is not visible then you can use the BaseWrapper.verify_visible(). BaseWrapper.verify_actionable() raises if the element is not both visible and enabled.
- parent()
Return the parent of this element
Note that the parent of a control is not necesarily a dialog or other main window. A group box may be the parent of some radio buttons for example.
To get the main (or top level) window then use BaseWrapper.top_level_parent().
- root()
Return wrapper for root element (desktop)
- set_focus()
Set the focus to this element
- texts()
Return the text for each item of this control
It is a list of strings for the control. It is frequently overridden to extract all strings from a control with multiple items.
It is always a list with one or more strings:
The first element is the window text of the control
Subsequent elements contain the text of any items of the control (e.g. items in a listbox/combobox, tabs in a tabcontrol)
pyOpenRPA позволяет обеспечить максимальную совместимость со всеми приложениями, которые выполняются на компьютере. Мы рекомендуем разрабатывать робота под интерпретатором Python x64. В дополнение к нему Вы можете подключить Python x32 (см. ниже пример подключения). Если планируемый робот не будет взаимодействовать через pyOpenRPA.Robot.UIDesktop с другой разрядность, то эту настройку можно не применять.
# В нашем случае процесс робота будет исполняться на Python x64. Дополнительно подключим Python x32 (делать это только, если вы планируете работать в другой разрядностью в рамках робота)
# Теперь при вызове функций pyOpenRPA.Robot.UIDesktop платформа pyOpenRPA будет отслеживать разрядность приложения и отправлять соответсвующий вызов на идентичную разрядность.