2017-01-03 12 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中列出。

相關問題