2017-01-03 11 views
0

在我的应用程序中,我想确保窗口对于继续自动化场景是可见的。现在,该应用程序有多个窗口没有名称。有没有一种方法可以确定地恢复窗口? Control_id不适用于我,所以我没有看到任何解决方案,除非使用自动化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} 

回答

0

有窗搜索歧许多可能的标准。如果没有可用名称,则仍有found_indexparent条件。示例:

# 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中列出。

相关问题