← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #173899]: Robot Framework Problem

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
The following setup works on my Win 7, so I guess it will work on XP
too, since these are basics.

As you can see, I am using RFW 2.6.3 (but I do not think, that matters
anyhow).

-------- the work folder c:\rfw contains

robotframework-2.6.3.jar
sik_module.sikuli
some-test.txt
runrfw.cmd

for this comment, it is assumed, that everything is stored here.
If you have other needs, it might be necessary, to adjust path's accordingly.

--- the basic batch file runrfw.cmd

set work=c:\rfw\
set rfwj=%work%robotframework-2.6.3.jar
set sikj=c:\Program Files\Sikuli X\sikuli-script.jar
set CLASSPATH=%rfwj%;%sikj%
set JYTHONPATH=%work%sik_module.sikuli;%rfwj%\Lib;%sikj%\Lib
java org.robotframework.RobotFramework %*

-------- rfw testing setup some-test.txt

*** Settings ***
Library     OperatingSystem
Library     sik_module

*** Variables ***
${MESSAGE}  Hello from RobotFrameWork!

*** Test Cases ***
Sikuli Test Script  [Documentation]  Script test
    Log         calling function from Sikuli script
    sik_popup   used from script module

-------- keywords setup with Sikuli script: sik_module.sikuli
(containing sik_module.py)

from sikuli import * # mandatory, since the script is imported
def sik_popup(text):
    popup(text)

You might do in Sikuli script anything, that is allowed to do with
Python in the RFW environment.

To manage your images, the following might be the easiest way:

make a e.g. LoadSikuliScripts.py containing:
from sikuli import *
from script1 import *
from script2 import *
....

and add to test settings:
Library     LoadSikuliScripts

this would use Sikuli to import all your scripts and populate the image
path accordingly.


-------- usage

cd c:\rfw
runcfw <options> <test-definition>

where 
<options> might be any RFW command line options
<test-definition> one or more RFW files containing test setups (.html, .tsv, .txt, ...)

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