robotframework-SikuliLibrary icon indicating copy to clipboard operation
robotframework-SikuliLibrary copied to clipboard

Getting "FAILED SikuliLibrary Initializing test library 'SikuliLibrary' with no arguments failed: Sikuli jar package should be exist in lib folder"

Open deepakg4all opened this issue 6 years ago • 4 comments

Hi, I am evaluating robot+sikuli but I am getting below error though I set Java_home,python_home and define all require sikuli libraries in env variable. Also, http://127.0.0.1:10000/ working properly.

Error via RIDE: FAILED SikuliLibrary Initializing test library 'SikuliLibrary' with no arguments failed: Sikuli jar package should be exist in lib folder Traceback (most recent call last): File "C:\Python27\lib\site-packages\robotide\lib\robot\running\testlibraries.py", line 184, in _get_instance return libcode(*self.positional_args, **self.named_args) File "C:\Python27\lib\site-packages\SikuliLibrary\sikuli.py", line 54, in init self.start_sikuli_process(port) File "C:\Python27\lib\site-packages\SikuliLibrary\sikuli.py", line 81, in start_sikuli_process self._start_sikuli_java_process() File "C:\Python27\lib\site-packages\SikuliLibrary\sikuli.py", line 153, in _start_sikuli_java_process raise Exception('Sikuli jar package should be exist in lib folder') Also in IDE getting "Setup failed: AttributeError: 'NoneType' object has no attribute 'run_keyword' additonal error.

Sample Code *** Settings *** Suite Setup Start Sikuli Process Suite Teardown Stop Remote Server Library SikuliLibrary mode=new

*** Test Cases *** New Mode Add Image Path C:\Users\test\Desktop\sikuli.sikuli Click click.png

Env Details : OS : Window 10 Python Version: 2.7 (32 bit) Robot Framework 3.0.2 (Python 2.7.13 on win32) Robot-SikuliLibrary : 1.0.1 (installed via pip install robotframework-SikuliLibrary )

Can you please help me to move ahead? Thanks in Advance.

deepakg4all avatar May 25 '18 11:05 deepakg4all

Could you confirm that "SikuliLibrary.jar" is existed in "C:\Python27\lib\site-packages\SikuliLibrary\lib". jarList = glob.glob(libFolder + os.sep + '*.jar') if len(jarList) != 1: raise Exception('Sikuli jar package should be exist in lib folder') python library will check "SikuliLibrary/lib" folder, and make sure there is only one jar file in the folder.

rainmanwy avatar May 26 '18 00:05 rainmanwy

Spot On, I see multiple Jars in that folder. I thought additional jar's won't create any issue. After deleting additional jars it worked like a charm. Thank man!

deepakg4all avatar May 30 '18 09:05 deepakg4all

I was having this same problem, I checked the .jar in the folder, but it was no use, so I did it to work: 1 - I made sure that JAVA JRE 64bits was installed; 2 - I searched the library in the python sikuli folder on my machine (in my case it was c:\users\mayara.fernandes\appdata\local\programs\python\python37-32\lib\site-packages\SikuliLibrary\lib) and put it not to be read only; 3 - Finally I changed the library code: In the library source code, in the file: C:\Users\mayara.fernandes\AppData\Local\Programas\Python\Python37-32\Lib\site-packages\SikuliLibrary\sikuli.py i opened it and changed the function named _start_sikuli_java_process, i changed: jarList = glob.glob (libFolder + os.sep + '* .jar') to: jarList = glob.glob (libFolder + os.sep + 'SikuliLibrary.jar')

mayribeirofernandes avatar Jan 13 '20 11:01 mayribeirofernandes

I was having this same problem, I checked the .jar in the folder, but it was no use, so I did it to work: 1 - I made sure that JAVA JRE 64bits was installed; 2 - I searched the library in the python sikuli folder on my machine (in my case it was c:\users\mayara.fernandes\appdata\local\programs\python\python37-32\lib\site-packages\SikuliLibrary\lib) and put it not to be read only; 3 - Finally I changed the library code: In the library source code, in the file: C:\Users\mayara.fernandes\AppData\Local\Programas\Python\Python37-32\Lib\site-packages\SikuliLibrary\sikuli.py i opened it and changed the function named _start_sikuli_java_process, i changed: jarList = glob.glob (libFolder + os.sep + '* .jar') to: jarList = glob.glob (libFolder + os.sep + 'SikuliLibrary.jar')

Thank you @mayribeirofernandes I was stuck with same issue and your solution worked for me. 👍

RaviGee avatar Sep 27 '20 07:09 RaviGee