Here you can find the functions description for interaction with desktop GUI applications
Here you can find the functions description for interaction with desktop GUI applications
How to use both x32 and x64 python processes (it can be helpfully, if another app GUI is on another bitness than your app)
************************
UIO объект
************************
************************
UIO селектор
************************
************************************************
UIO свойства и методы (общие)
************************************************
- process_id()
Return the ID of process that owns this window
- window_text()
Window text of the element
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 с другой разрядность, то эту настройку можно не применять.
..code-block:: python
..code-block:: python
from pyOpenRPA.Robot import UIDesktop
from pyOpenRPA.Robot import UIDesktop
#Section for robot init
#В нашем случае процесс робота будет исполняться на Python x64. Дополнительно подключим Python x32 (делать это только, если вы планируете работать в другой разрядностью в рамках робота)
lPyOpenRPA_SettingsDict = {
lPyOpenRPA_SettingsDict = {
"Python32FullPath": "..\\Resources\\WPy32-3720\\python-3.7.2\\python.exe", #Set from user: "..\\Resources\\WPy32-3720\\python-3.7.2\\OpenRPARobotGUIx32.exe"
"Python32FullPath": "..\\Resources\\WPy32-3720\\python-3.7.2\\python.exe",# Путь к интерпретатору Python.exe x32
"Python64FullPath": "..\\Resources\\WPy64-3720\\python-3.7.2.amd64\\python.exe", #Set from user
"Python64FullPath": "..\\Resources\\WPy64-3720\\python-3.7.2.amd64\\python.exe", # Путь к интерпретатору Python.exe x64
"Python32ProcessName": "pyOpenRPA_UIDesktopX32.exe", #Config set once
"Python32ProcessName": "pyOpenRPA_UIDesktopX32.exe", # Наименование процесса робота x32 в диспетчере задач. Установите свое наименование
"Python64ProcessName": "pyOpenRPA_UIDesktopX64.exe" #Config set once
"Python64ProcessName": "pyOpenRPA_UIDesktopX64.exe" # Наименование процесса робота x64 в диспетчере задач. Установите свое наименование
# Теперь при вызове функций pyOpenRPA.Robot.UIDesktop платформа pyOpenRPA будет отслеживать разрядность приложения и отправлять соответсвующий вызов на идентичную разрядность.
..automodule:: pyOpenRPA.Robot.UIDesktop
..automodule:: pyOpenRPA.Robot.UIDesktop
@ -29,7 +295,7 @@ How to use both x32 and x64 python processes (it can be helpfully, if another ap