[HowTo] integrate selenium in Sikuli IDE?

Asked by Hina on 2018-03-16

----------------------- solution

the steps to get it running from comment #5

1- Download and paste selenium standalone server jar file in user\<Username>\AppData\Roaming\Sikuli\Extensions folder.
2- Run command using sikuli script …..
3- load("selenium-server-standalone-3.11.0.jar")
if no error occurred then
4- download gekodriver and paste it in sikuli folder. (To open web application)
5- Execute following script should open firefox google window.
I have used python syntax instead of java cuz it was throwing error FirefoxDriver not defined

from org.openqa.selenium.firefox import FirefoxDriver
browser= FirefoxDriver()
browser.get('http://www.google.com')

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

Hi, I am working on an application which is desktop and web facing. I have created scripts for desktop app and now thinking to use selenium for web application.
Can I use selenium within Sikuli IDE?
Would appreciate if you could please guide me how can we integrate Selenium in sikuli IDE?

Question information

Language:
English Edit question
Status:
Solved
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Solved by:
Hina
Solved:
2018-03-22
Last query:
2018-03-22
Last reply:
2018-03-22
masuo (masuo-ohara) said : #1
Hina (hina-amir) said : #2

When I click on Tools--> Extensions it shows me a message

Not available yet - click what ypu like ;-)
OK Be quiet! Cancel

:( no idea why did I get this message?

Hina (hina-amir) said : #3

The solution in recommended case works fine till load command. But when we try to write code it won't work.
May be cuz I'm using Sikuli with python.

How can we install selenium webdriver for python version?

RaiMan (raimund-hocke) said : #4

When you use the SikuliX IDE and script using Python language, then internally the Java-based Jython interpreter is used.

This means, you can use any Java library (like the selenium jar) directly in your scripts.

As for selenium, you have to take care for the prerequisites, depending on what type of webdriver you want to use.

then the steps as of question mentioned in comment #1 work.

In any case, you should use SikuliX 1.1.1+

Hina (hina-amir) said : #5

So it worked. Here are the steps !!!

1- Download and paste selenium standalone server jar file in user\<Username>\AppData\Roaming\Sikuli\Extensions folder.
2- Run command using sikuli script …..
3- load("selenium-server-standalone-3.11.0.jar")
if no error occurred then
4- download gekodriver and paste it in sikuli folder. (To open web application)
5- Execute following script should open firefox google window.
I have used python syntax instead of java cuz it was throwing error FirefoxDriver not defined

from org.openqa.selenium.firefox import FirefoxDriver
browser= FirefoxDriver()
browser.get('http://www.google.com')

Thanks RaiMan :)

RaiMan (raimund-hocke) said : #6

thanks for reporting back your solution. I put it to the top.