<div dir="ltr"><div dir="ltr"><div dir="ltr">Hi team,<div><br></div><div>I have one requirement, in which i need to connect to HP ALM and log a defect in jira using python. i tried to connect to alm through pywin32. but getting error. please check below code snippet and error - </div><div><br></div><div><u><b>code </b>-</u></div><div><pre style="color:rgb(0,0,0);font-family:"Courier New";font-size:9pt"><span style="color:rgb(0,0,128);font-weight:bold">import </span>win32com<br><span style="color:rgb(0,0,128);font-weight:bold">from </span>win32com.client <span style="color:rgb(0,0,128);font-weight:bold">import </span>Dispatch</pre><pre style="color:rgb(0,0,0);font-family:"Courier New";font-size:9pt"><br></pre><pre style="color:rgb(0,0,0);font-family:"Courier New";font-size:9pt">qcServer = <span style="color:rgb(0,128,128);font-weight:bold">""<br></span>qcUser = <span style="color:rgb(0,128,128);font-weight:bold">""<br></span>qcPassword = <span style="color:rgb(0,128,128);font-weight:bold">""<br></span>qcDomain = <span style="color:rgb(0,128,128);font-weight:bold">""<br></span>qcProject = <span style="color:rgb(0,128,128);font-weight:bold">""<br></span>td = win32com.client.Dispatch(<span style="color:rgb(0,128,128);font-weight:bold">"TDApiOle80.TDConnection.1"</span>)<br><br><br>    <span style="color:rgb(128,128,128);font-style:italic">#Starting to connect<br></span>td.InitConnectionEx(qcServer)<br>td.Login(qcUser, qcPassword)<br>td.Connect(qcDomain, qcProject)<br><span style="color:rgb(0,0,128);font-weight:bold">if </span>td.Connected <span style="color:rgb(0,0,128);font-weight:bold">is True</span>:<br>    <span style="color:rgb(0,0,128)">print</span>(<span style="color:rgb(0,128,128);font-weight:bold">"Connected to " </span>+ qcProject)<br><span style="color:rgb(0,0,128);font-weight:bold">else</span>:<br>    <span style="color:rgb(0,0,128)">print</span>(<span style="color:rgb(0,128,128);font-weight:bold">"Connection failed"</span>)</pre><pre style="color:rgb(0,0,0);font-family:"Courier New";font-size:9pt"><br></pre><pre style="color:rgb(0,0,0);font-family:"Courier New";font-size:9pt"><b><u>Error</u></b> -</pre><pre><font color="#000000" face="Courier New">   IDispatch = pythoncom.connect(IDispatch)
pywintypes.com_error: (-2147221021, 'Operation unavailable', None, None)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:/Users/Ajit_Mallick/PycharmProjects/Test/almcon.py", line 11, in <module>
    td = win32com.client.Dispatch("TDApiOle80.TDConnection.1")
  File "C:\Users\Ajit_Mallick\PycharmProjects\Test\venv\lib\site-packages\win32com\client\__init__.py", line 95, in Dispatch
    dispatch, userName = dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx)
  File "C:\Users\Ajit_Mallick\PycharmProjects\Test\venv\lib\site-packages\win32com\client\dynamic.py", line 114, in _GetGoodDispatchAndUserName
    return (_GetGoodDispatch(IDispatch, clsctx), userName)
  File "C:\Users\Ajit_Mallick\PycharmProjects\Test\venv\lib\site-packages\win32com\client\dynamic.py", line 91, in _GetGoodDispatch
    IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx, pythoncom.IID_IDispatch)
pywintypes.com_error: (-2147221164, 'Class not registered', None, None)

Process finished with exit code 1</font><span style="color:rgb(0,0,0);font-family:"Courier New";font-size:9pt">
</span></pre><div><br></div><pre style="color:rgb(0,0,0);font-family:"Courier New";font-size:9pt">Regards,</pre><pre style="color:rgb(0,0,0);font-family:"Courier New";font-size:9pt">Neeraj Chhabra</pre></div></div></div></div>