Python-UIAutomation-for-Windows
Python-UIAutomation-for-Windows copied to clipboard
用SendKeys('{PageDown}')或DragDrop滚动页面后,下方的控件无法处理,报Can not move cursor. TextControl's BoundingRectangle is (0,0,0,0)[0x0]. SearchProperties: {Name: 'XXX', ControlType: TextControl}错误
pyWindow = auto.WindowControl(searchDepth=1, Name='aaa') pyWindow.SendKeys('{PageDown}') 或这段pyWindow.GroupControl().DragDrop(464, 500, 464, 680, moveSpeed=5, waitTime=1) pyWindow.TextControl(Name='bbb').Click()
执行后控制台报
有一些控件 Rectangle出来的坐标就是 (0,0,0,0),这个时候可以考虑直接用automation.DragDrop ,不通过识别不到的控件来获取,而是用其能够识别到的相对控件,然后计算radioX和radioY的偏移量来实现
有一些控件 Rectangle出来的坐标就是 (0,0,0,0),这个时候可以考虑直接用automation.DragDrop ,不通过识别不到的控件来获取,而是用其能够识别到的相对控件,然后计算radioX和radioY的偏移量来实现
我发现是我调用了滚动之后,下方的控件通过uiautomation抓取坐标是0,0,0,0,但是通过Inspect查看的BoundingRectangle是正常的。不行只能暂时通过做坐标去处理了