【发布时间】:2017-06-05 13:08:28
【问题描述】:
我是 Pywinauto 的新手,登录远程桌面应用程序后尝试单击“ENTER”。桌面窗口有一个带有“确定”按钮的使用免责声明,我可以按“ENTER”或鼠标移动以单击“确定”。下面是代码 sn-p 和我得到的错误。
rem_app = Application(backend="uia").connect(title_re='.*Remote desktop.*')
dlg_rem = rem_app.window(title_re='.*Remote desktop.*')
dlg_rem.set_focus()
dlg_rem.typekeys('{ENTER}')
错误: Traceback(最近一次调用最后一次):文件“”,第 1 行,在文件中 “C:\Python27\lib\site-packages\pywinauto\application.py”,第 171 行,在 致电 format(self.criteria[-1]['best_match'])) AttributeError: WindowSpecification 类没有'typekeys'方法
我还通过查看其他相关的 stackoverflow 问题来使用以下内容:
- keyboard.sendkeys('{ENTER}')
- dlg_rem.sendkeys('{ENTER}')
下面是 print_control_identifiers() 对“确定”按钮的描述。
| | | | Pane - '' (L403, T360, R1671, B1320)
| | | | [u'3', 'Pane4']
| | | | |
| | | | | Pane - 'Input Capture Window' (L403, T360, R1671, B1320)
| | | | | [u'Input Capture Window', u'Input Capture WindowPane', 'Pane5']
| | | | | child_window(title="Input Capture Window", control_type="Pane")
我想知道在上述两种情况下如何使用发送键和鼠标移动单击“确定”。
【问题讨论】:
标签: pywinauto