Python-UIAutomation-for-Windows icon indicating copy to clipboard operation
Python-UIAutomation-for-Windows copied to clipboard

请教 _ctypes.COMError: (-2147220991, '事件无法调用任何订户', (None, None, None, 0, None)) 报错如何处理?

Open JokerYF opened this issue 3 years ago • 3 comments
trafficstars

image 如图,如果出现该类型报错,应该如何定位和处理?

JokerYF avatar Apr 20 '22 09:04 JokerYF

大多数情况是,控件消失了还使用就会报这个,会变化的控件使用前最好先检查是否存在(.Exists)

L-Yucheng avatar Oct 19 '22 01:10 L-Yucheng

我也遇到類似問題,使用invoke去觸動一個button,且實際的視窗確實有動作,但後續還是會卡在這個error return,目前似乎只能用click去防止這狀況產生,但這樣就失去了彈性必須要元件可見才能click。

另一個類似library似乎也有這樣的問題: https://github.com/pywinauto/pywinauto/issues/563

zmh00 avatar Jan 02 '23 09:01 zmh00

通过element.Exists(1)来判断控件是否存在时会报这个错,后来时间增长,改为element.Exists(3)则无报错。

floraXiao avatar Mar 08 '24 02:03 floraXiao