1
嗨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