Python-UIAutomation-for-Windows
Python-UIAutomation-for-Windows copied to clipboard
(Donot use 3.7.6,3.8.1):snake:Python 3 wrapper of Microsoft UIAutomation. Support UIAutomation for MFC, WindowsForm, WPF, Modern UI(Metro UI), Qt, IE, Firefox, Chrome ...
window = uiautomation.WindowControl(Name="Remote Desktop Connection", searchDepth=1) print(window.Exists()) 上述代码在pycharm里执行成功,用pyinstaller -F 打包后的exe在当前打包的机器上执行也成功, 但把exe放到另一台没有安装Python的机器上时就提示标题所述的异常。 uiautomation version = 2.0.3, 系统是win10 RS5 5855 in Exists 7678 in FindControl 7460 in GetRootControl 51 in instance 57...
怎样输出正确的emoji字符呢
作者您好,由于python的特性,函数定义时的默认参数似乎在程序运行的瞬间,就已经固定了无法更改,例如: `def SendKey(key: int, waitTime: float = OPERATION_WAIT_TIME) -> None:` SendKey()函数(其他函数都是这种情况)在代码编译时,waitTime就已经固定为0.5s,无法通过改变uiautomation.uiautomation.OPERATION_WAIT_TIME值,更改全局的等待时间,只能每一个方法后都加入waitTime参数,类似的情况还有修改SEARCH_INTERVAL值无效。 建议改为在函数内把OPERATION_WAIT_TIME值赋予waitTime,类似于DEBUG_SEARCH_TIME的逻辑
请教_ctypes.COMError: (-2147352573, '找不到成员。', (None, None, None, 0, None))怎么处理
 如图,如果出现该类型报错,应该如何定位和处理?
希望添加根据 进程id (ProcessId) 获取 main Window
我有一个元素叫map是ListItemControl,我是否可以通过SendKey()进行鼠标点击的操作呢?从document文件中找到了鼠标右键的值是{VK_RBUTTON:2},但是我通过`map.SendKey(2)`没有实现鼠标右击,请问该如何操作呢?谢谢。
作者你好,我是刚刚接触这个库,觉得非常好用;我想问一下,如何快速的查找控件。 我通过光标获取到了元素控件,然后我把元素控件里面的Name,automationId, ClassName, ControlType这几个属性存储在了本地文件。我想实现快速的根据存储信息查找元素。我目前是通过这种方式找的,但是感觉不是很快,下面是部分代码截图: tips: 是通过读取本地存储的元素信息进行查找的。 with open(self._locators_path, 'r') as f: locators_data = json.loads(f.read())[name] control = auto.GetRootControl() def compare(locator): def find(child, depth): if child.Name == locator['Name'] and child.ClassName == locator['ClassName']...
wnd = uiautomation.WindowControl(Name='Settings') wnd.SetActive() scl = wnd.ScrollBarControl(Name='Vertical') m = scl.CurrentMaximum() scl.RangeValuePatternSetValue(m) 上述代码我自己写的按照数值去滚动,验证过可行,但不知您推荐的用法是不是这么用, 另外,怎么按照百分比去滚动?
One console win10 has mstsc another win10 by python+uiautomaton,Even remote windows is maxim, uiautomaton still can not find remote windows handle,only search in local win10.Why?How to fixed?