1

I'm trying to run automatic test within CANoe from Jenkins. I wrote python scripts using CANoe COM interface. It can work normally with command line in the local computer(configured as the Jenkins slave). But when I tried to call the python scripts from Jenkins, I got the error as below.

Traceback (most recent call last):
  File "automatic_test.py", line 165, in <module>
    app = CanoeSync()
  File "automatic_test.py", line 23, in __init__
    app = win32com.client.gencache.EnsureDispatch("CANoe.Application")
  File "C:\Python27\lib\site-packages\win32com\client\gencache.py", line 527, in EnsureDispatch
    disp = win32com.client.Dispatch(prog_id)
  File "C:\Python27\lib\site-packages\win32com\client\__init__.py", line 95, in Dispatch
    dispatch, userName = dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx)
  File "C:\Python27\lib\site-packages\win32com\client\dynamic.py", line 114, in _GetGoodDispatchAndUserName
    return (_GetGoodDispatch(IDispatch, clsctx), userName)
  File "C:\Python27\lib\site-packages\win32com\client\dynamic.py", line 91, in _GetGoodDispatch
    IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx, pythoncom.IID_IDispatch)
pywintypes.com_error: (-2147024891, 'Access is denied.', None, None)

Other information: CANoe version: 11.0SP2; Python version: 2.7;. Jenkins account is also the admin account for the slave computer. The python scripts work normally with the Jenkins account locally.

Thanks a lot for any help.

Lydia Li
  • 11
  • 2

2 Answers2

0

Finally, the issue was resolved! It's a permission issue. Please try the solution from Win32com codes not working on IIS and remember to add your Jenkins user name and set full permission.

Lydia Li
  • 11
  • 2
0

Am facing the same problem when am trying to launch CANoe application from Jenkins even after following the steps mentioned in Win32com codes not working on IIS. If I execute script from CMD it works fine but problem is observed on launching from jenkins with my user ID Are there any specific settings to be done in CANoe as well

File "C:\Program Files (x86)\Python279\lib\site-packages\win32com\client\dynamic.py", line 91, in _GetGoodDispatch
    IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx, pythoncom.IID_IDispatch)
pywintypes.com_error: (-2147467238, 'The server process could not be started because the configured identity is incorrect. Check the username and password.', None, None)
Ds Arjun
  • 349
  • 2
  • 6
  • 16