0

无法通过 Disppatch 方法连接到 HP ALM。

执行以下代码:

import win32com.client
qc = win32com.client.Dispatch("TDApiOle80.TDConnection")

在具有 ALM 版本 12.55 的 Windows 64 位计算机上导致以下错误。

Traceback (most recent call last): File"C:\Users\User1\AppData\Local\Programs\Python\Python37-32\lib\sit``e-packages\win32com\client\dynamic.py", line 89, in _GetGoodDispatch IDispatch = pythoncom.connect(IDispatch) pywintypes.com_error: (-2147221005, 'Invalid class string', None, None)

在处理上述异常的过程中,又出现了一个异常:

Traceback (most recent call last):  
File "<stdin>", line 1, in <module>File"C:\Users\User1\AppData\Local\Programs\Python\Python37-32\lib\site-packages\win32com\client\
__init__.py", line 95, in Dispatch
    dispatch, userName = dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx)

File "C:\Users\User1\AppData\Local\Programs\Python\Python37-32\lib\site-packages\win32com\client\
dynamic.py", line 114, in _GetGoodDispatchAndUserName

return (_GetGoodDispatch(IDispatch, clsctx), userName)
File "C:\Users\User1\AppData\Local\Programs\Python\Python37-32\lib\site-packages\win32com\client\
dynamic.py", line 91, in _GetGoodDispatch
IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx, pythoncom.IID_IDispatch)
pywintypes.com_error: (-2147221005, 'Invalid class string', None, None)

如何解决这个问题?

4

1 回答 1

1

确保您安装了正确版本的 ALM Connectivity 工具 (TDConnect.exe)http://<youralmserver:port>/qcbin/PlugIns/TDConnectivity/TDConnect.exe

于 2019-01-09T11:15:38.717 回答