Reputation: 320
While writing scripts, I am attempting to look at some items in the Device Manager. The only issue is that pywinauto cannot see the device manager. Below is what I get when looking for "Device Manager":
Could not find 'Device Manager' in 'dict_keys(['', 'Pane', 'Taskbar', 'Pane0', 'Pane1', 'Pane2', 'TaskbarPane',
'Pane3', 'NetBannerPane', 'Pane4', 'NetBanner', 'ListBox', 'Program ManagerPane', 'Program Manager', 'Pane5'])'
I have attempted to print_control_identifiers() for all of the items listed here however, none of them are the device manager. Looking within Inspect.exe, I can clearly see that there is a window with the title of "Device Manager".
I've even tried to access it via:
dlg=Desktop(background='uia')
dlg.window(class_name="MMCMainFrame").print_control_identifiers()
However, it also provides an error stating that it's an invalid name for the element and it cannot be found. Has anyone else ever attempted to use pywinauto to look at the Device Manager? Or had an issue being unable to find an element
Upvotes: 0
Views: 904
Reputation: 321
try using this code:
dlg = Desktop(background="uia")
dlg.window(title="Device Manager").print_control_identifiers()
Use title or title_re instead of class_name. dlg.window(title="Device Manger") returns device manager window handler if window is opened already. Heres find window documentation
Upvotes: 1