Unable to load Selenium Jar file in Eclipse sikuli ide

Asked by Maria Haris on 2018-03-14

@Raiman
I have recently setup the sikuli on the eclipse using the method you mentioned in the
https://answers.launchpad.net/sikuli/+question/179741
In my sikuli script I am importing the selenium jar file by the following command
Load("selenium-server-standalone-3.0.1.jar")
This command works fine in the sikuli ide but I get the following error when I run it on Eclipse:
Traceback (most recent call last):
  File "C:\Sikuli\AutomatedSmokeTests\Start.sikuli\StartCCC.py", line 2, in <module>
    load("selenium-server-standalone-3.0.1.jar")
NameError: name 'load' is not defined
Is there something I am missing ?

Question information

Language:
English Edit question
Status:
Solved
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
2018-04-03
Last query:
2018-04-03
Last reply:
2018-03-14
RaiMan (raimund-hocke) said : #1

You have to take care, that the folder
<Sikulix-AppData>/Lib

is in your Python path.

see:
https://github.com/RaiMan/SikuliX-2014/wiki/Jython-in-IDEs-like-Eclipse-or-running-it-from-commandline

Maria Haris (mariaharis) said : #2

I have added the path of sikulixapi.jar to the java home in the environmental variables.
I have also added the following lines in the begining of my code

import org.sikuli.script.SikulixForJython
from sikuli import *

but I am getting the error :

    import org.sikuli.script.SikulixForJython
ImportError: No module named sikuli

RaiMan (raimund-hocke) said : #3

what version of SikuliX?

what system?

what Java version?

Maria Haris (mariaharis) said : #4

sikuli x version 1.1.0
Windows 10
 java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
Eclipse IDE for Java Developers
Version: Neon.1a Release (4.6.1)

Best RaiMan (raimund-hocke) said : #5

... and you should switch to version 1.1.2

Maria Haris (mariaharis) said : #6

Thanks RaiMan, that solved my question.