Can anyone support me this case?
I install the same steps in 2 machines with similar configurations. But one machine works. One machine fails when importing AutoItLibrary.
View Ride log - the error shows:
20190322 16:34:04.751 [WARN]: Importing test library "AutoItLibrary" failed
Traceback (most recent call last):
Initializing test library 'AutoItLibrary' with no arguments failed: com_error: (-2147221008, 'CoInitialize has not been called.', None, None)
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\robotide\lib\robot\running\testlibraries.py", line 167, in _get_instance
return libcode(*self.positional_args, **dict(self.named_args))
File "C:\Python27\lib\site-packages\AutoItLibrary\__init__.py", line 84, in __init__
self._AutoIt = win32com.client.Dispatch("AutoItX3.Control")
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 108, in _GetGoodDispatchAndUserName
return (_GetGoodDispatch(IDispatch, clsctx), userName)
File "C:\Python27\lib\site-packages\win32com\client\dynamic.py", line 85, in _GetGoodDispatch
IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx, pythoncom.IID_IDispatch)
File "C:\Python27\lib\site-packages\robotide\spec\librarymanager.py", line 87, in _fetch_keywords
return get_import_result(path, library_args)
File "C:\Python27\lib\site-packages\robotide\spec\libraryfetcher.py", line 24, in get_import_result
lib = robotapi.TestLibrary(path, args)
File "C:\Python27\lib\site-packages\robotide\lib\robot\running\testlibraries.py", line 54, in TestLibrary
lib.create_handlers()
File "C:\Python27\lib\site-packages\robotide\lib\robot\running\testlibraries.py", line 100, in create_handlers
self._create_handlers(self.get_instance())
File "C:\Python27\lib\site-packages\robotide\lib\robot\running\testlibraries.py", line 159, in get_instance
self._libinst = self._get_instance(self._libcode)
File "C:\Python27\lib\site-packages\robotide\lib\robot\running\testlibraries.py", line 169, in _get_instance
self._raise_creating_instance_failed()
File "C:\Python27\lib\site-packages\robotide\lib\robot\running\testlibraries.py", line 314, in _raise_creating_instance_failed
% (self.name, args_text, msg, details))
20190322 16:34:05.048 [INFO]: Found Robot Framework version 3.1.1 from C:\Python27\lib\site-packages\robot.
20190322 16:34:05.048 [INFO]: Started RIDE 1.7.3.1 using python version 2.7.14 with wx version 4.0.4 in win32.
I suspect the AutoItX3.dll is not registered, which outputs a COM error.
The code above is batch-file, so you could save it as e.g.
autoitx_comtest.cmd
. It uses JScript to try to load theAutoItX3.Control
object. If it fails and the script is running as admin, it will register the dlls if exist in the directory.AutoitLibrary usually only provides the 32 bit dll, which is
AutoItX3.dll
. If you want 64 bit as well, addAutoItX3_x64.dll
to the directory to be registered. If you have AutoIt3 installed, then you may already have the dlls registered by the installer.If you have Python 64 bit installed, then
AutoItX3_x64.dll
may be required to use AutoItLibrary with it as 64 bit executables cannot use 32 bit dlls and vice versa.Note: If you know how to register dlls with
regsvr32
, then you could just use that instead of the batch-file.Compatibility with additional dlls
For compatibility with AutoItLibrary using an older version 3.3.6.0 of
AutoItX3.dll
. I could recommend using dlls from the archived versions and downloading autoit-v3.3.6.0-sfx.exe to get the dlls. In the latest AutoItX version, some methods were removed, such asRegRead
. Also, the AutoItLibrary author may not support any version other than 3.3.6.0.If you have the latest AutoIt Installer installed, then you may need to unregister those dlls and ensure the 3.3.6.0 dlls are registered to be compatible. I am unsure if you can have different versions of the dlls registered at the same time, on the same system.
The latest version of AutoItX dlls may work quite well, but AutoItLibrary keywords listed in the Documentation, such as
Reg Read
,Reg Write
and some others may not be available as the methods were removed from the latest versions.Latest vs compatibility, your choice.
I had the same problem and tested with 32 bit library then worked.