← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #261208]: [1.1.0] Robot Framework: how to use together with SikuliX (user keywords / test libraries)

 

Question #261208 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/261208

Summary changed to:
[1.1.0] Robot Framework: how to use together with SikuliX (user keywords / test libraries)

Description changed to:
------ This is a setup that definitely works:

RFW = Robot Framework

--- preparations:
- have Python 2.7+ installed 
- install RobotFrameWork using the respective installer (Windows installer.exe) (2.8+)
… now you have a useable RFW together with Python

since we want to use SikuliX features, you need
- an actual Java (recommended 7 or 8)
- install Jython or download the Jython standalone jar (needed 2.7b3)
- have a sikulixapi.jar created with setup (version 1.1.0+)

now create a command file jybot (or however you name it) wherever you
want:

(this the Windows jybot.bat version, Mac and Linux users should be able
to adapt ;-)

@echo off
setlocal
set ROBOT_HOME=<PythonInstallationFolder>/Lib/site-packages
set JYTHON_HOME=<folderContaining-jython.jar>
set SIKULIX_HOME=<folderContaining-sikulix.jar>

set CLASSPATH=%SIKULIX_HOME%sikulixapi.jar;%CLASSPATH%
set JYTHONPATH=%SIKULIX_HOME%sikulixapi.jar\Lib

java -cp %JYTHON_HOME%jython.jar;%CLASSPATH% org.python.util.jython ^
                %ROBOT_HOME%robot\run.py ^
                --pythonpath=<folderContainingLibraries>/someLibrary.sikuli ^
               %*
endlocal

--- usage to run tests
jybot.bat <…. any RFW parameters …> <pathToYourRFW-testFile>

This is only a showcase, to point out the key needs.
I used different folder variables for the participating stuff (RFW, Jython and SikuliX).
to allow, to use any other folder organization and adjust the variables as needed.

more actual information, test setups and help:
https://github.com/Tset-Noitamotua/Sikuli-and-Robot-Framework-Integration

-----------------------------------------------------------------------------------------------

Hi,

  I am  following below blog to run calculator test in my windows 7.

http://blog.mykhailo.com/2011/02/how-to-sikuli-and-robot-
framework.html?showComment=1422206385305#c361348174523267467


  Now I got stucked in STEP 2. I am getting following error:


C:\Users\test\Desktop\Projects\Sikuli Projects\calc.sikuli>robottest.bat verif
y_operations.txt
Exception in thread "main" Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\test\Desktop\Projects\Sikuli Projects\calc.sikuli\robotframew
ork-2.5.5.jar\Lib\robot\__init__$py.class", line 16, in <module>
  File "C:\Users\test\Desktop\Projects\Sikuli Projects\calc.sikuli\Lib\os.py",
 line 118, in <module>
    raise ImportError, 'no os specific module found'
ImportError: no os specific module found

C:\Users\test\Desktop\Projects\Sikuli Projects\calc.sikuli>


My robottest.bat content:


@echo off

set sikulix_jar=C:\robot\libs\sikuli-script.jar
set robot_framework_jar=C:\Users\symbol\Desktop\Projects\Sikuli Projects\calc.sikuli\robotframework-2.5.5.jar

java -cp "%robot_framework_jar%;%sikulix_jar%" ^
     -Dpython.path="%sikulix_jar%/Lib" ^
     org.robotframework.RobotFramework ^
     --pythonpath=calc.sikuli ^
     --outputdir=results ^
     --loglevel=TRACE ^
     %*	 

 Could anyone please guide me on this.

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.