sikulix remote server with jython start error:[error] ImagePath: addImagePath: not valid: /

Asked by ai

i download the latest sikuli 1.1.0 beta4 and setup;
Environment Variables is like this:
JAVA_HOME C:\Program Files (x86)\Java\jdk1.7.0_05
CLASSPATH F:\SikuliX\1.1.0\sikulixapi.jar;.;%JAVA_HOME%\lib;%JAVA_HOME%\lib\tools.jar
JYTHONPATH C:\jython2.5.3\Lib;C:\jython2.5.3\sikulixapi.jar\Lib

while i Integration sikulix with robotframework (Remote Library), when start Remote Server,I got this error message:

[error] ImagePath: addImagePath: not valid: /
[error] ImagePath: addImagePath: not valid: /
Robot Framework remote server at 127.0.0.1:8270 starting.

but,the robotframework can still connect the server and call this keyword(click_object) remotely sucessfully;
i don't know,why i got this error message?

i start remote server by this command: jython sikuliServer.py

sikuliServer.py source is like this:

import sys
from robotremoteserver import RobotRemoteServer
from org.sikuli.script import *
class SikuliRemoteLibrary:
 def __init__(self):
  self.SS = Screen()
  self.PT = Pattern()

 def _wait(self,imgFile,timeOut,similarity):
  self.PT = Pattern(imgFile)
  self.PT = self.PT.similar(float(similarity))
  self.SS.wait(self.PT,float(timeOut))

 def click_object(self, imgFile, timeOut, similarity):
  try:
   self._wait(imgFile, timeOut, similarity)
   self.SS.click(imgFile)
  except FindFailed, err:
   raise AssertionError("Cannot click [" + imgFile + "]")

if __name__ == '__main__':
 SRL = SikuliRemoteLibrary()
 RobotRemoteServer(SRL, *sys.argv[1:])

how to resolve this error message ? thank you so much

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

--1. download the latest ready-to-use sikulixapi-1.1.0.jar from nightly build

--2. if you want to use the SikuliX Java API, then you should not add
sikulixapi.jar\Lib
to your JYTHONPATH

You have to decide to either use the Sikuli Jython API
- having sikulixapi.jar\Lib on sys.path
- using
from sikuli import *
which implements a Jython wrapper around the Java API (which allows to use the undotted methods like find, wait, click using the primary screen a search region)

or to use the Java API directly only having sikulixapi.jar on the class path using
from org.sikuli.script import *

(which I would not do anyways, but import every needed class separately)

--2. ImagePath error
You might ignore this error if you use image file names with absolute path.
The concepts of Sikuli generally allows to use image folders and relative image names.
… and the basic image folder is the so called bundle (which usually is a .sikuli folder containing the images and the script)

So the most simple case is:
ImagePath.setBundlePath("absolute path to folder containing your images")
someRegion.find("someImage.png") # .png might be omitted

will find the image file in the given folder

the ImagePath class allows to add more folders to the image path.
setBundlePath always sets the first entry.

… more info should be found in the javadocs

Revision history for this message
RaiMan (raimund-hocke) said :
#2

… of course you might download the sikulixsetup.jar as well and setup your own customized sikulixapi.jar.

Can you help with this problem?

Provide an answer of your own, or ask ai for more information if necessary.

To post a message you must log in.