rainmanwy / robotframework-SikuliLibrary

Sikuli Robot Framework Library provide keywords for Robot Framework to test UI through Sikuli.
Apache License 2.0
147 stars 61 forks source link

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

Open deepakg4all opened 6 years ago

deepakg4all commented 6 years ago

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.

rainmanwy commented 6 years ago

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.

deepakg4all commented 6 years ago

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!

mayribeirofernandes commented 4 years ago

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')

RaviGee commented 4 years ago

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. 👍