我应该如何处理调试NULL COM指针访问错误?
问题描述:
嗨Stack Overflow社区,我应该如何处理调试NULL COM指针访问错误?
我需要为客户端自动化专有应用程序。我已经能够成功运行一些示例代码here(即pywinauto在记事本上工作)。对于专有应用程序,似乎任何最终的elements_from_uia_array(ptrs_array, cache_enable)
调用失败,特别是针对此应用程序的相同NULL COM指针访问错误。我应该如何解决这个问题?
语境:
- 环境:Windows 10的Python 3.6.2,pywinauto-0.6.3
- 观察:自动化谷歌浏览器时,没有空COM错误&记事本
这里我试图从WindowsSpecification创建包装器对象时得到的堆栈跟踪。任何顶级窗口上的print_control_identifiers()
也给我同样的错误。
>>> test = actual_window.child_window(auto_id="_buttonFindStudent",control_type="Button")
>>> test
<pywinauto.application.WindowSpecification object at 0x000002277006DC50>
>>> profit = test.wrapper_object()
Traceback (most recent call last):
File "<pyshell#30>", line 1, in <module>
profit = test.wrapper_object()
File "C:\Users\SK2\AppData\Local\Programs\Python\Python36\lib\site-packages\pywinauto\application.py", line 254, in wrapper_object
ctrls = self.__resolve_control(self.criteria)
File "C:\Users\SK2\AppData\Local\Programs\Python\Python36\lib\site-packages\pywinauto\application.py", line 245, in __resolve_control
criteria)
File "C:\Users\SK2\AppData\Local\Programs\Python\Python36\lib\site-packages\pywinauto\timings.py", line 425, in wait_until_passes
func_val = func(*args)
File "C:\Users\SK2\AppData\Local\Programs\Python\Python36\lib\site-packages\pywinauto\application.py", line 209, in __get_ctrl
ctrl = self.backend.generic_wrapper_class(findwindows.find_element(**ctrl_criteria))
File "C:\Users\SK2\AppData\Local\Programs\Python\Python36\lib\site-packages\pywinauto\findwindows.py", line 84, in find_element
elements = find_elements(**kwargs)
File "C:\Users\SK2\AppData\Local\Programs\Python\Python36\lib\site-packages\pywinauto\findwindows.py", line 214, in find_elements
depth=depth)
File "C:\Users\SK2\AppData\Local\Programs\Python\Python36\lib\site-packages\pywinauto\uia_element_info.py", line 283, in descendants
elements = self._get_elements(IUIA().tree_scope["descendants"], cond, cache_enable)
File "C:\Users\SK2\AppData\Local\Programs\Python\Python36\lib\site-packages\pywinauto\uia_element_info.py", line 262, in _get_elements
return elements_from_uia_array(ptrs_array, cache_enable)
File "C:\Users\SK2\AppData\Local\Programs\Python\Python36\lib\site-packages\pywinauto\uia_element_info.py", line 48, in elements_from_uia_array
for n in range(ptrs.Length):
ValueError: NULL COM pointer access
类似于这样的问题:https://github.com/pywinauto/pywinauto/issues/296要尽快修复它(本月)。 –
你可以尝试从[这个分支]修复(https://github.com/airelil/pywinauto/archive/dev.zip)? –
将尝试修复并让你知道! – AMemberofDollars