Here you can find the docs and examples of the OpenRPA desktop (GUI) app access. # Definitions **UIO** - UI Object (class of pywinauto UI object) [pywinauto.base_wrapper]
**UIOSelector** - List of dict (key attributes)
**PWA** - PyWinAuto
**PWASpecification** - List of dict (key attributes in pywinauto.find_window notation)
**UIOTree** - Recursive Dict of Dict ... (UI Parent -> Child hierarchy)
**UIOInfo** - Dict of UIO attributes
**UIOActivity** - Activity of the UIO (UI object) from the Pywinauto module
**UIOEI** - UI Object info object # What is UIO? UIO is a User Interface Object (pyOpenRPA terminology). For maximum compatibility, this instance is inherited from the object model developed in the [pywinauto library (click to get a list of available class functions)](https://pywinauto.readthedocs.io/en/latest/code/pywinauto.base_wrapper.html). This approach allows us to implement useful functionality that has already been successfully developed in other libraries, and Supplement it with the missing functionality. In our case, the missing functionality is the ability to dynamically access UIO objects using UIO selectors. # UIOSelector structure & example UIOSelector is the list of condition items for the UIO in GUI. Each item has condition attributes for detect applicable UIO. Here is the description of the available condition attributes in item. **Desciption**
``` [ { "depth_start" :: [int, start from 1] :: the depth index, where to start check the condition list (default 1), "depth_end" :: [int, start from 1] :: the depth index, where to stop check the condition list (default 1), "ctrl_index" || "index" :: [int, starts from 0] :: the index of the UIO in parent UIO child list, "title" :: [str] :: the condition for the UIO attribute *title*, "title_re" :: [str] :: regular expression (python ver) for the condition for the UIO attribute *title*, "rich_text" :: [str] :: the condition for the UIO attribute *rich_text*, "rich_text_re" :: [str] :: regular expression (python ver) for the condition for the UIO attribute *rich_text*, "class_name" :: [str] :: the condition for the UIO attribute *class_name*, "class_name_re" :: [str] :: regular expression (python ver) for the condition for the UIO attribute *class_name*, "friendly_class_name" :: [str] :: the condition for the UIO attribute *friendly_class_name*, "friendly_class_name_re" :: [str] :: regular expression (python ver) for the condition for the UIO attribute *friendly_class_name*, "control_type" :: [str] :: the condition for the UIO attribute *control_type*, "control_type_re" :: [str] :: regular expression (python ver) for the condition for the UIO attribute *control_type*, "is_enabled" :: [bool] :: the condition for the UIO attribute *is_enabled*. If UI object is enabled on GUI, "is_visible" :: [bool] :: the condition for the UIO attribute *is_visible*. If UI object is visible on GUI, "backend" :: [str, "win32" || "uia"] :: the method of UIO extraction (default "win32"). ATTENTION! Current option can be only for the first item of the UIO selector. For the next items this option will be implemented from the first item. }, { ... specification next level UIO } ] ``` **The UIO selector example** ``` [ {"class_name":"CalcFrame", "backend":"win32"}, # 1-st level UIO specification {"title":"Hex", "depth_start":3, "depth_end": 3} # 3-rd level specification (because of attribute depth_start|depth_stop) ] ``` # The UIDesktop module (OpenRPA/Robot/UIDesktop.py) The UIDesktop is extension of the pywinauto module which provide access to the desktop apps by the **win32** and **ui automation** dll frameworks (big thx to the Microsoft :) ). ## Functions *Naming convention: \\_\\_\*
### List - [UIOSelector_Get_UIOList](#UIOSelector_Get_UIOList) - [UIOSelector_Get_UIO](#UIOSelector_Get_UIO) - [UIOSelector_Exist_Bool](#UIOSelector_Exist_Bool) - [UIOSelectorsSecs_WaitAppear_List](#UIOSelectorsSecs_WaitAppear_List) - [UIOSelectorsSecs_WaitDisappear_List](#UIOSelectorsSecs_WaitDisappear_List) - [UIOSelectorSecs_WaitAppear_Bool](#UIOSelectorSecs_WaitAppear_Bool) - [UIOSelectorSecs_WaitDisappear_Bool](#UIOSelectorSecs_WaitDisappear_Bool) - [UIOSelector_Get_BitnessInt](#UIOSelector_Get_BitnessInt) - [UIOSelector_SearchChildByMouse_UIO](#UIOSelector_SearchChildByMouse_UIO) - [UIOSelector_SearchChildByMouse_UIOTree](#UIOSelector_SearchChildByMouse_UIOTree) - [UIOSelector_Get_UIOInfoList](#UIOSelector_Get_UIOInfoList) - [UIOSelector_IsExist_Bool](#UIOSelector_IsExist_Bool) - [UIOSelector_WaitAppear_Dict](#UIOSelector_WaitAppear_Dict) - [UIOSelector_TryRestore_Dict](#UIOSelector_TryRestore_Dict) - [UIOSelector_Get_UIOActivityList](#UIOSelector_Get_UIOActivityList) - [UIOSelectorUIOActivity_Run_Dict](#UIOSelectorUIOActivity_Run_Dict) - [UIOSelector_Get_UIOInfo](#UIOSelector_Get_UIOInfo) - [UIOSelector_GetChildList_UIOList](#UIOSelector_GetChildList_UIOList) - [UIOSelector_SearchUIONormalize_UIOSelector](#UIOSelector_SearchUIONormalize_UIOSelector) - [UIOSelector_SearchProcessNormalize_UIOSelector](#UIOSelector_SearchProcessNormalize_UIOSelector) - [UIOSelector_FocusHighlight](#UIOSelector_FocusHighlight) - [UIOSelector_Highlight](#UIOSelector_Highlight) ### Description **`UIOSelector_Get_UIOList (inUIOSelector,inParentUIO=None,inFlagRaiseException=True)`**
___ Get the list of the UIO items
___ **inUIOSelector** - UIOSelector - List of items, which contains condition attributes ([see UIOSelector Structure&Examples](#UIOSelector_Structure_Examples))
**inParentUIO** - Technical argument. Applicable only if you has UIO object, which is parent for the futher search the child UIO.
**inFlagRaiseException** - if True - raise exception if UIO hasn't been detected. False - don't raise the exception - return None.
___ **`UIOSelector_Get_UIO (inUIOSelector,inParentUIO=None,inFlagRaiseException=True)`**
___ Get first (if more than one UIO are applied) UIO (UI Object)
___ **inUIOSelector** - UIOSelector - List of items, which contains condition attributes ([see UIOSelector Structure&Examples](#UIOSelector_Structure_Examples))
**inParentUIO** - Technical argument. Applicable only if you has UIO object, which is parent for the futher search the child UIO.
**inFlagRaiseException** - if True - raise exception if UIO hasn't been detected. False - don't raise the exception - return None.
___ **`UIOSelector_Exist_Bool (inUIOSelector)`**
___ Check if UIO exist (Identified by the UIOSelector)
___ **inUIOSelector** - UIOSelector - List of items, which contains condition attributes ([see UIOSelector Structure&Examples](#UIOSelector_Structure_Examples))
___ **`UIOSelectorsSecs_WaitAppear_List (inUIOSelectorList,inWaitSecs,inFlagWaitAllInMoment=False)`**
___ Wait for UIO is appear (at least one of them or all at the same time). return: \[0,1,2\] - index of UIOSpecification, which is appear
___ **inUIOSelectorList** - !ATTENTION! Current argument is not the UIOSelector. This is the !list! of the many UIO selectors. ([see UIOSelector Structure&Examples](#UIOSelector_Structure_Examples))
**inWaitSecs** - Time in seconds to wait the UIO will appear.
**inFlagWaitAllInMoment** - True - wait when UIO of the all UIOSelectors will appear. False - at least one UIO of the UIOSelector list.
___ **`UIOSelectorsSecs_WaitDisappear_List (inUIOSelectorList,inWaitSecs,inFlagWaitAllInMoment=False)`**
___ Wait for UIO is Disappear (at least one of them or all at the same time). return: \[0,1,2\] - index of UIOSpecification, which is Disappear
___ **inUIOSelectorList** - !ATTENTION! Current argument is not the UIOSelector. This is the !list! of the many UIO selectors. ([see UIOSelector Structure&Examples](#UIOSelector_Structure_Examples))
**inWaitSecs** - Time in seconds to wait the UIO will appear.
**inFlagWaitAllInMoment** - True - wait when UIO of the all UIOSelectors will appear. False - at least one UIO of the UIOSelector list.
___ **`UIOSelectorSecs_WaitAppear_Bool (inUIOSelector,inWaitSecs)`**
___ Wait for UIO is appear (at least one of them or all at the same time). return: Bool - True - UIO is appear.
___ **inUIOSelector** - UIOSelector - List of items, which contains condition attributes ([see UIOSelector Structure&Examples](#UIOSelector_Structure_Examples))
**inWaitSecs** - Time in seconds to wait the UIO will appear.
___ **`UIOSelectorSecs_WaitDisappear_Bool (inUIOSelector,inWaitSecs)`**
___ Wait for UIO is disappear (at least one of them or all at the same time) . return: Bool - True - UIO is Disappear.
___ **inUIOSelector** - UIOSelector - List of items, which contains condition attributes ([see UIOSelector Structure&Examples](#UIOSelector_Structure_Examples))
**inWaitSecs** - Time in seconds to wait the UIO will appear.
___ **`UIOSelector_Get_BitnessInt (inUIOSelector)`**
___ Get process bitness (32 or 64). return None (if Process not found), int 32, or int 64
___ **inUIOSelector** - UIOSelector - List of items, which contains condition attributes ([see UIOSelector Structure&Examples](#UIOSelector_Structure_Examples))
___ **`UIOSelector_SearchChildByMouse_UIO(inUIOSelector)`**
___ Run the search UIO by mouse hover event. result = UIO element wrapper instance or None
___ **inUIOSelector** - UIOSelector - List of items, which contains condition attributes ([see UIOSelector Structure&Examples](#UIOSelector_Structure_Examples))
___ **`UIOSelector_SearchChildByMouse_UIOTree(inUIOSelector)`**
___ Run the search UIO by mouse hover event. result = UIO element wrapper instance or None
___ **inUIOSelector** - UIOSelector - List of items, which contains condition attributes ([see UIOSelector Structure&Examples](#UIOSelector_Structure_Examples))
___ **`UIOSelector_Get_UIOInfoList (inUIOSelector,inElement=None)`**
___ Get the UIOEI object.
___ **inUIOSelector** - UIOSelector - List of items, which contains condition attributes ([see UIOSelector Structure&Examples](#UIOSelector_Structure_Examples))
___ **`UIOSelector_IsExist_Bool (inUIOSelector)`**
___ Check is the UIO/UIO's by the UIOSelector exist
___ **inUIOSelector** - UIOSelector - List of items, which contains condition attributes ([see UIOSelector Structure&Examples](#UIOSelector_Structure_Examples))
___ **`UIOSelector_WaitAppear_Dict(inUIOSelector,inTimeout=60)`**
___ Wait for the UIO by the UIOSelector appear
___ **inUIOSelector** - UIOSelector - List of items, which contains condition attributes ([see UIOSelector Structure&Examples](#UIOSelector_Structure_Examples))
___ **`UIOSelector_TryRestore_Dict(inUIOSelector)`**
___ Try to restore (maximize) window, if it's minimized. (!IMPORTANT! When use UIA framework minimized windows doesn't appear by the UIOSelector. You need to try restore windows and after that try to get UIO)
___ **inUIOSelector** - UIOSelector - List of items, which contains condition attributes ([see UIOSelector Structure&Examples](#UIOSelector_Structure_Examples))
___ **`UIOSelector_Get_UIOActivityList (inUIOSelector)`**
___ Get the list of the UI object activities
___ **inUIOSelector** - UIOSelector - List of items, which contains condition attributes ([see UIOSelector Structure&Examples](#UIOSelector_Structure_Examples))
___ **`UIOSelectorUIOActivity_Run_Dict(inUIOSelector,inActionName,inArgumentList=\[\],inkwArgumentObject={})`**
___ Run the activity in UIO (UI Object)
___ **inUIOSelector** - UIOSelector - List of items, which contains condition attributes ([see UIOSelector Structure&Examples](#UIOSelector_Structure_Examples))
**inActionName** - UIOActivity (name) from Pywinauto
___ **`UIOSelector_Get_UIOInfo(inUIOSelector)`**
___ Get the UIO dict of the attributes
___ **inUIOSelector** - UIOSelector - List of items, which contains condition attributes ([see UIOSelector Structure&Examples](#UIOSelector_Structure_Examples))
___ **`UIOSelector_GetChildList_UIOList(inUIOSelector=\[\],inBackend=mDefaultPywinautoBackend)`**
___ Get list of child UIO's by Parent UIOSelector
___ **inUIOSelector** - UIOSelector - List of items, which contains condition attributes ([see UIOSelector Structure&Examples](#UIOSelector_Structure_Examples))
___ **`UIOSelector_SearchUIONormalize_UIOSelector (inUIOSelector)`**
___ Technical def. Do UIOSelector normalization for the search processes.
___ **inUIOSelector** - UIOSelector - List of items, which contains condition attributes ([see UIOSelector Structure&Examples](#UIOSelector_Structure_Examples))
___ **`UIOSelector_SearchProcessNormalize_UIOSelector (inUIOSelector)`**
___ Technical def. Do UIOSelector normalization for the search processes.
___ **inUIOSelector** - UIOSelector - List of items, which contains condition attributes ([see UIOSelector Structure&Examples](#UIOSelector_Structure_Examples))
___ **`UIOSelector_FocusHighlight(inUIOSelector)`**
___ Set focus and highlight (draw outline) the element (in app) by the UIO selector.
___ **inUIOSelector** - UIOSelector - List of items, which contains condition attributes ([see UIOSelector Structure&Examples](#UIOSelector_Structure_Examples))
___ **`UIOSelector_Highlight(inUIOSelector)`**
___ Highlight (draw outline) the element (in app) by the UIO selector.
___ **inUIOSelector** - UIOSelector - List of items, which contains condition attributes ([see UIOSelector Structure&Examples](#UIOSelector_Structure_Examples))
___