在pc端自动化测试中在 VS Code中运行代码
from pywinauto.application import Application
app = Application("uia").start(r"D/.exe")
dlg = app["Qt5QWindowIcon"]
dlg.print_control_identifiers()
一直报错提示
Could not find 'Qt5QWindowIcon' in 'dict_keys(['Pane'])'
窗口类名是用spy+获取的
然后去开发哪里核对说是没有Qt5QWindowIcon这个,但是spy+和ViewWizard反馈给我的都是这个
求解答
Qt5QWindowIcon只是控件的class_name,窗口用窗口标题文本查找匹配,qt应用控件的话用auto_id定位会好一点。