where is sikuli-script.jar equivalent when integrating with Robotframework, Selenium
i try to integrate Sikuli with Robotframework, Selenium.
I am using Sikuli 1.1.0 nightly wituild 20150610 in windows7 64 bit .
I am following some integration information as following:
http://
Many information is written back to 2012. So they talked about sikuli-scripts.jar.
My question is what is the equivalent to sikuli-script.jar when I use Sikuli 1.1.0
i unzipped sikulix.jar and sikulixapi.jar in local folder 2 times sequentially. I tried to run
' jython.bat SikuliRemoteLib
From org.sikuli.script import *.
I doubt the problem is version issue.
'
4.Copy C:\\Program Files\\Sikuli X\\sikuli-
5.Add C:\\robot\
6.Run the remote server. Go to: C:\\robot\\libs and type: jython.bat SikuliRemoteLib
7.Launch RIDE. From the command line type: ride.py
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- peter huang
- Solved:
- Last query:
- Last reply:
Revision history for this message
|
#1 |
I am using JDK1.8 in windows7 64 bit.
Revision history for this message
|
#2 |
The mentioned post is a bit out dated ;-)
... but thanks for the pointer: I already contacted the owner, to help him make an update.
In any case: setup with the latest nightly build and do that when new builds arise until final is out, since I am currently working with some usage issues and convenience functions that address integration.
1. supposing you have run a setup 1.1.0 with appropriate options, so you have a sikulix.jar and a sikulixapi.jar.
ALWAYS use the jars as jars, do not unzip - does not help anything at runtime.
If you want to know more about the internals: https:/
2. you might either use sikulix.jar or sikulixapi.jar. In the letter case you need a separately installed Jython. For serious work, the approach as in the mentioned post is the recommended.
SikuliX 1.1.0 adds a few conveniences:
- https:/
- http://
my recommendation (like the steps in the mentioned post)
- with a valid Python 2.7 installation, get everything besides Sikuli running (RFW, Selenium, ...)
- install Jython 2.7 and ensure it works
- setup SikuliX (sikulixapi.jar)
- integrate Jython and sikulixapi,jar according 2. and do some basic tests with Jython interactive (or setup .py scripts with an editor or IDE and run them)
- then try to get RFW running
Revision history for this message
|
#3 |
come back with runtime output if you get stuck.
Revision history for this message
|
#4 |
Thanks, RailMan, You are always quick to respond.
But integration is a bit difficult.
I just type Jython SikuliRemoteLib
I get the following error message:
[error] RunTimeINIT: ****terminating: no valid Java context for Sikulix available (java.security.
Revision history for this message
|
#5 |
are you now on 1.1.0?
is sikulix.jar or sikulixapi.jar on java class path?
is your script setup according to comment #2 section 2.) ?
Revision history for this message
|
#6 |
i am using 1.1.0 , sikulixapi.jar is on my java class path.
what is comment #2 section 2.)?
Revision history for this message
|
#7 |
all the following are done
You might use export or any other appropriate method.
In cases you do not want to run scripts from inside the SikuliX IDE or from command line using the SikuliX command scripts or jar-files, you might setup your own Jython environment and run scripts.
Apply the following steps, to get a Jython environment, that is SikuliX aware:
download the installer package from Jython Downloads
install (usually by double-clicking the package) using the standard setup into an empty folder
test by running <jython-
make sure, that pip and easy_install are available:
<jython-
<jython-
if this is not the case run <jython-
if this is still not the case follow the steps further below Fallback without pip
run <jython-
add any needed Python package (must not depend on C-based stuff) using pip, easy-install or manual methods into <jython-
Revision history for this message
|
#8 |
my enviroment variables are as following:
ALLUSERSPROFILE
ANDROID_
ANT_HOME=
APPDATA=
asl.log=
ChocolateyInsta
Classpath=
CommonProgramFi
CommonProgramFi
CommonProgramW6
COMPUTERNAME=
ComSpec=
FP_NO_HOST_CHECK=NO
HOMEDRIVE=C:
HOMEPATH=
JAVA_HOME=
JYTHONPATH=
JYTHON_
LOCALAPPDATA=
LOGONSERVER=
M2_HOME=
MAVEN_HOME=
MOZ_PLUGIN_
NUMBER_
OPENSSL_
OS=Windows_NT
Path=C:
PATHEXT=
PROCESSOR_
PROCESSOR_
PROCESSOR_LEVEL=6
PROCESSOR_
ProgramData=
ProgramFiles=
ProgramFiles(
ProgramW6432=
PROMPT=$P$G
PSModulePath=
PUBLIC=
SESSIONNAME=Console
SIKULI_
SystemDrive=C:
SystemRoot=
TEMP=C:
TMP=C:\
USERDOMAIN=witon-PC
USERNAME=witon
USERPROFILE=
VS100COMNTOOLS=
VS110COMNTOOLS=
VS120COMNTOOLS=
windir=C:\Windows
windows_
windows_
Revision history for this message
|
#9 |
in E:\ on my disk, i have installed 4 sikuli all 1.1.0
E:\ 的目录
2015/06/12 17:23 <DIR> Sikuli
2015/06/25 18:16 <DIR> Sikulix
2015/06/25 17:23 <DIR> Sikulix-2014
2015/06/08 03:55 <DIR> SikuliX2014
2015/06/11 21:26 2,984,506 sikulixsetup-
2015/06/10 14:46 <DIR> Sikuli_new
1 个文件 2,984,506 字节
5 个目录 142,807,056,384 可用字节
in Sikuli_Home, i am poitin
Revision history for this message
|
#10 |
in Sikuli_Home, i am pointing to Sikutlix-2014. does it matter to have mutiple Sikuli folders?
Revision history for this message
|
#11 |
I have deleted mutiple Sikuli folders but the same errors. No valid Java context for Sikuli availble Java.Security.
Revision history for this message
|
#13 |
what is the getlocation() here? is anything wrong?
the programme i want to run with Jython is as following:
import sys
import org.sikuli.
# from sikuli.Sikuli import *
from robotremoteserver import RobotRemoteServer
from org.sikuli.script import *
class SikuliRemoteLib
def __init__(self):
self.SS = Screen()
self.PT = Pattern()
def _wait(self, imgFile, timeOut, similarity):
try:
self.PT = Pattern(imgFile)
self.PT = self.PT.
self.
except FindFailed, err:
print "ERR: _wait"
raise AssertionError(err)
def click_object(self, imgFile, timeOut, similarity):
try:
self.
self.
except FindFailed, err:
raise AssertionError(
def object_exists(self, imgFile, similarity, timeOut):
try:
self.
except FindFailed, err:
raise AssertionError(
def type_at_
try:
self.
self.
except FindFailed, err:
raise AssertionError(
def paste_at_
try:
self.
self.
except FindFailed, err:
raise AssertionError(
if __name__ == '__main__':
SRL = SikuliRemoteLib
RobotRemoteSer
Revision history for this message
|
#14 |
starting to comment your stuff
***** the start of your program is not correct:
--- you have:
import org.sikuli.
# from sikuli.Sikuli import *
from robotremoteserver import RobotRemoteServer
from org.sikuli.script import *
--- but MUST be
import org.sikuli.
from sikuli import *
from robotremoteserver import RobotRemoteServer
# from org.sikuli.script import * # THIS IS SIMPLY forbidden!!!
# the API needed for Jython scripting is made available by
# from sikuli import *
**** use exists() instead of wait to avoid exception handling:
instead of
try:
self.
except:
...
use
if not self.SS.
# handle the failed situation
# continue with the normal workflow
use
Revision history for this message
|
#15 |
@ comment #8:
you have C:\Program Files (x86)\Sikuli X\libs in your system path.
When working with 1.1.0 you should purge or hide everything, that has to do with any prior Sikuli version.
SIKULI_HOME is no longer needed and not recognised.
A correctly setup sikulix.
Revision history for this message
|
#16 |
the mentioned error
[error] RunTimeINIT: ****terminating: no valid Java context for Sikulix available (java.security.
simply means, that the class org.sikuli.
Conclusion: you have some terrible mix in your setup.
So before doing any more complex things, you should start again from beginning and verify each step.
You should not do anything in your environment, but setup a command file, that at runtime sets up the correct environment.
So you have more control.
Revision history for this message
|
#17 |
thanks Railman, one more question for Sikuli setup. When Sikuli Setup, users are asked to choose options, can i choose options 1, 2 at the same time?
Thanks.
Revision history for this message
|
#18 |
This helped me get the remote server launched.
https:/
Revision history for this message
|
#19 |
Correct usage of jython requires jython -cp YOUR-CLASSPATH script.py
Revision history for this message
|
#20 |
i have got the key points. It is related to Jython classpath.
I use following Jythonpath, it works.
If Sikulixapi.jar is one Jar, why JYTHONPATH should be like following?
%sikulix_
set sikulix_
set CLASSPATH=
set JYTHONPATH=
Revision history for this message
|
#21 |
in comment #14 I told you:
MUST BE:
import org.sikuli.
from sikuli import *
SikulixForJython is the helper, to put the sikulixapi.jar/Lib on sys.path, if sikulixapi.jar is on the CLASSPATH.
sikulixapi.jar/Lib
MUST be on sys.path/
from sikuli import *
working.
so you either use JYTHONPATH (as you did now) or class path only, but then <import org.sikuli.
These are the current documented usage rules ;-)
I am working on a more automatic solution for all that especially with respect to the integration of Selenium and RobotFramework.