Selenium Grid with Sikuli?

Asked by joe fu

I'm working to integrate sikuli with selenium into a test framework. It's working fine with selenium RC. We can do it either in Java or Python. As selenium and sikuli support both languages. Currently I'm using Python and Python to do it. Do you think it may be better to use java?

Is it possible to integrate Sikuli with selenium Grid? Anyone has any idea how to approach it?

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

Interesting: you say: Currently I'm using Python and Python to do it.

Do you already have a working set up together with Sikuli script?

Can you talk a little bit about your development environment and set up and the settings you use to run a test?

Revision history for this message
joe fu (jfu-yahoo) said :
#2

Hi RaiMan,

sorry, i meant 'Currently I'm using Jython and PyUnit to do it.' to run sikuli and selenium together in the same sikuli script.
Basically I run it as a sikuli script using the command line option
start /B "Launching GUI test now...." %JAVA_EXE% -Xms64M -Xmx512M -Dfile.encoding=UTF-8 -Dpython.path=..\utils -jar ..\utils\Sikuli-X\sikuli-script.jar ..\..\GUITest.sikuli 1> ..\results\GUITestLog1.txt 2> ..\results\GUITestLog2.txt

Since selenium support python, you can just import the selenium module, that's all.
more reference: http://seleniumhq.org/docs/05_selenium_rc.html, look for the python part.

this is the example function I have below to run sikuli and selenium in pyUnit.

from selenium import selenium
import unittest
def login():
 wait(img_DesktopLabel,50)
 #using selenium
 #-----------------
 sel_wait(sel_userNameTextField,30)
 sel.type(sel_userNameTextField, userNameData)
 sel.type(sel_passwordField, passwordData)
 sel.type(sel_domainField, domainData)
 sel.click(sel_loginBtn)
 sel.wait_for_page_to_load("30000")
 #-----------------
 wait(img_homeIcon,15)
 wait(img_machinesLabel)
 wait(img_usageLabel)
 wait(img_infrastructureLabel)
 print("login works!")

This works perfectly to integrate selenium RC into Sikuli. I'd like to expand it to use selenium Grid, which I'm not sure it's possible. Any idea?

I'm also wondering if we can integrate other tools into sikuli to make it more powerful?

Revision history for this message
joe fu (jfu-yahoo) said :
#3

already provided more info

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

@ Selenium Grid

Since there seems to be no other experiences with Selenium RC / Grid (including myself ;-), you have to check it on your own.

From the Grid description, I could not see, wether you can use the Python approach already or wether it is restricted to Java. So the only thing might be, that you have to switch to using Sikuli on the Java level (have a look at the doc how to use the Sikuli features on the Java level).

In any case there should not be a principal problem, since you have it running with RC.

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

@ integrate other tools into sikuli

What tools are you thinking about?

--- comments based on the current situation of Sikuli X:
- everything that is available to be imported on the Python level and is supported by Jython, can be integrated/used (like Selenium RC)
- everything that is available to be imported on the Java level can be used, if it is supported by the Jython environment (like swing etc.)
- when using Java as your main environment, you can use the Sikuli features as a library and are open to do what you want
- at any time you may extend the existing Python and/or Java classes with your own features and import these as modules.

Revision history for this message
daluu (cuuld) said :
#6

For using with Selenium Grid, that depends on your use case.

If you are thinking of having multiple machines with same or different browsers to test, managed/controlled via Selenium Grid, and also in tandem, remotely execute Sikuli on each of those machines to perform automation that is complementary to Selenium, then no, tough luck.

You would have a hard time synchronizing or mapping which remote machine to execute Sikuli on for which browser that the Grid hub controls. This gets more complicated the more machines you scale up.

That is because we have no WhateverToolNameGrid or SeleniumPlusToolGrid solution. There is only a grid for Selenium. For other tools, you have to figure out where will you find an equivalent grid. No one has yet started work on such a non-Selenium Grid.

Can you help with this problem?

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

To post a message you must log in.