pywinauto / pywinauto

Windows GUI Automation with Python (based on text properties)
http://pywinauto.github.io/
BSD 3-Clause "New" or "Revised" License
4.86k stars 686 forks source link

_ctypes.COMError: (-2147467259, '未指定的错误', (None, None, None, 0, None)) #770

Open ghost opened 5 years ago

ghost commented 5 years ago
app["name"].menu_select("Tools->Settings")

Expected Behavior

Traceback (most recent call last):
  File "D:\Python36\lib\site-packages\pywinauto\uia_defines.py", line 234, in get_elem_interface
    iface = cur_ptrn.QueryInterface(cls_name)
  File "D:\Python36\lib\site-packages\comtypes\__init__.py", line 1158, in QueryInterface
    self.__com_QueryInterface(byref(iid), byref(p))
ValueError: NULL COM pointer access

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\Python36\lib\site-packages\pywinauto\controls\uia_controls.py", line 949, in select
    self.iface_selection_item.Select()
  File "D:\Python36\lib\site-packages\pywinauto\controls\uiawrapper.py", line 132, in __get__
    value = self.fget(obj)
  File "D:\Python36\lib\site-packages\pywinauto\controls\uiawrapper.py", line 224, in iface_selection_item
    return uia_defs.get_elem_interface(elem, "SelectionItem")
  File "D:\Python36\lib\site-packages\pywinauto\uia_defines.py", line 236, in get_elem_interface
    raise NoPatternInterfaceError()
pywinauto.uia_defines.NoPatternInterfaceError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "E:/PyProject/WinAuto/main.py", line 26, in <module>
    app["name"].menu_select("Tools->Settings").set_focus()
  File "D:\Python36\lib\site-packages\pywinauto\controls\uiawrapper.py", line 723, in menu_select
    menu.item_by_path(path, exact).select()
  File "D:\Python36\lib\site-packages\pywinauto\controls\uia_controls.py", line 952, in select
    self.iface_invoke.Invoke()
_ctypes.COMError: (-2147467259, '未指定的错误', (None, None, None, 0, None))

When I click on the menu "Settings", a new settings interface will pop up, and the code will be wrong.

Specifications

vasily-v-ryabov commented 5 years ago

It would be useful to know on which GUI framework the application was built. Is it Qt5 or WinForms or another kind of application?

Is there any possibility to download it for debugging purpose?