Re: I can run test by invoking sikuli-script.jar but not by invoking robotframework.jar

726 views
Skip to first unread message

Travis Thomas

unread,
Apr 16, 2013, 6:45:01 PM4/16/13
to robotframe...@googlegroups.com
Alternatively, if there is a walkthrough for RIDE that can specifically demonstrate how to configure sikuli within it that'd be great. 

I was able to get through almost all of this walk-through, but got stuck after running the test in the command line. I've tried a zillion combinations of Library imports and Jybot/Pybot arguments, but can't get RIDE to run the test. I just get the Java usage print.

Thanks for the help.

On Tuesday, April 16, 2013 11:19:45 AM UTC-7, Travis Thomas wrote:
When I execute this in my Windows 7 environment, the test runs: 

C:\Test_Cases>java.exe -Dpython.path=Lib -jar sikuli-script.jar webmin_tests.sikuli

However, when I attempt to run the test through the Robot Framework, I can't get it to work. Here's my command: 

C:\Test_Cases>java -jar C:\Java_lib\robot.jar run webmin.txt
[ ERROR ] Error in file 'C:\Test_Cases\webmin.txt' in table 'Settings': Importing test library 'C:\Test_Cases\webmin_tests.sikuli\webmin_tests.py'
 failed: ImportError: No module named sikuli
Traceback (most recent call last):
  File "C:\Test_Cases\webmin_tests.sikuli\webmin_tests.py", line 1, in <module>
    from sikuli.Sikuli import *
  File "Lib\sikuli\__init__.py", line 3, in <module>
    from Sikuli import *
  File "Lib\sikuli\Sikuli.py", line 10, in <module>
    from org.sikuli.script import SikuliScript
PYTHONPATH:
  C:\Java_lib\robot.jar\Lib\robot\libraries
  C:\Java_lib\robot.jar\Lib
  Lib
  C:\Java_lib\Lib
  __classpath__
  __pyclasspath__/
  .
  C:\Python27\Lib\site-packages\robot
CLASSPATH:
  C:\Java_lib\robot.jar 

I have also run this command (I renamed robotframework-2.7.7.jar to robot.jar for brevity): 

C:\Test_Cases>java -Dpython.path=Lib -jar C:\Java_lib\robot.jar run webmin.txt
[ ERROR ] Error in file 'C:\Test_Cases\webmin.txt' in table 'Settings': Importing test library 'C:\Test_Cases\webmin_tests.sikuli\webmin_tests.py
 failed: ImportError: No module named sikuli 

Here's the import statement it is barfing over from webmin_tests.py: 

from sikuli.Sikuli import *

In my webmin_tests.sikuli directory, I have both the sikuli-script.jar file and the extracted Lib directory. 

Thanks for any insight!

David

unread,
Apr 16, 2013, 9:06:24 PM4/16/13
to robotframe...@googlegroups.com
Worse case scenario, you could look into using Sikuli as remote library and import that from RIDE. Sikuli can be run as Jython remote library or pure Java remote library (using Sikuli Java API instead of Jython API).

Teppo Testaaja

unread,
Apr 17, 2013, 9:36:42 AM4/17/13
to robotframe...@googlegroups.com
Well, when running sikuli tests you always have to set the classpath explicitly to point to sikuli-script.jar. So in your case you could try:

set CLASSPATH=C:\Test_Cases\webmin_tests.sikuli\sikuli-script.jar;

java -jar C:\Java_lib\robot.jar run webmin.txt

The failure message in your post indicated that the sikuli-script.jar is not in the java classpath.
I am not sure if this proposal will work but hopefully this helps. I have been running Jython-based sikuli tests from Robot Framework using the jybot command, and I have managed to get it working, but I have not tried to run Robot Framework as a stand-alone .jar

Br,
Teppo

Kevin O.

unread,
Apr 17, 2013, 11:43:14 AM4/17/13
to robotframe...@googlegroups.com
Teppo is right in that the problem is the sikuli jar is not on the classpath, but the suggested command needs to be tweaked a bit.
When using the -jar argument to the JVM, the CLASSPATH environmental variable is ignored by design. This is explained on https://code.google.com/p/robotframework/wiki/JavaIntegration.
Try:

set CLASSPATH=C:\Test_Cases\webmin_tests.sikuli\sikuli-script.jar;C:\Java_lib\robot.jar

java org.robotframework.RobotFramework run webmin.txt


Kevin 
Reply all
Reply to author
Forward
0 new messages