在我的应用程序中,我希望确保窗口可见,以继续自动化场景。现在,应用程序有多个没有名称的窗口。有没有方法可以确定地恢复一个窗口?Control_id对我来说是不可用的,所以除非使用自动化id,否则我看不到任何解决方案。
有关详细信息,请参阅:
panel.get_properties()
Out[37]: {'exstyle': 65536, 'rectangle': <RECT L827, T79, R1017, B527>, 'is_unicode': True, 'control_id': 197612, 'fonts': [<LOGFONTW 'MS Shell Dlg' -11>], 'client_rects': [<RECT L0, T0, R190, B448>], 'context_help_id': 0, 'friendly_class_name': 'WindowsForms10.Window.8.app.0.33c0d9d', 'is_visible': True, 'control_count': 3, 'is_enabled': True, 'texts': [''], 'menu_items': [], 'class_name': 'WindowsForms10.Window.8.app.0.33c0d9d', 'style': 1442840576, 'user_data': 0}发布于 2017-01-22 05:06:30
有许多可能的窗口搜索消歧标准。如果没有可用的名称,您仍然可以使用found_index或parent标准。示例:
# find the second button with empty title
app.MainWindow.child_window(title="", control_type="Button", found_index=1).click()
# find the button under the group box
# (may work in master branch only because of known bug in 0.6.0)
app.MainWindow.child_window(title="", class_name="Button", parent=app.MainWindow.GroupBox1).click()find_elements() function中列出了所有可能的关键字。
https://stackoverflow.com/questions/41439857
复制相似问题