Reputation: 2347
Using python 3.10 i am trying to use pywinauto and print_control_identifiers for a PyQt5 app (for example Qt Designer).
from pywinauto.application import Application
import os
app = Application().start("C:/python/Lib/site-packages/QtDesigner/designer.exe")
main_dlg = app.QtDesigner
main_dlg.wait('visible')
main_dlg.print_control_identifiers()
output:
Control Identifiers:
Qt5QWindowIcon - 'Qt Designer' (L632, T250, R1928, B1008)
['Qt Designer', 'Qt DesignerQt5QWindowIcon', 'Qt5QWindowIcon']
child_window(title="Qt Designer", class_name="Qt5QWindowIcon")
It's strange maybe the control identifiers are in child_window(title="Qt Designer", class_name="Qt5QWindowIcon") but how can i access them?
Upvotes: 1
Views: 318
Reputation: 2347
from pywinauto.application import Application
import os
app = Application(backend="uia").start("C:/python/Lib/site-packages/QtDesigner/designer.exe")
main_dlg = app.QtDesigner
main_dlg.wait('visible')
main_dlg.print_control_identifiers()
backend="uia" fix the problem. If not for related problems try backend="win32"
Upvotes: 2