Selenium Remote Control is a server that needs to be running so that Funittest can run functional tests in a browser.
You can use the included buildout to install Selenium RC using the recipe collective.recipe.seleniumrc. This requires a current version of Java (see requirements below).
To get started quickly execute the following from the funittest directory:$ python bootstrap.py $ ./bin/buildout
You will now have a script in the bin folder named seleniumrc which will start SeleniumRC. You may also use any command line options with this script such as -interactive. For example:
$ bin/seleniumrc -interactive
For more information on zc.buildout see the zc.buildout page on PyPI.
Use a version of Selenium RC > 0.9.1 available at:
The Selenium RC Java application does not need to be installed, but can be started right from where you have extracted it on your file system.
If you are not familiar with JAR format, here is a small introduction:
"JAR (Java Archive) is a platform-independent file format that aggregates many files into one. Multiple Java applets and their requisite components (.class files, images and sounds) can be bundled in a JAR file and subsequently downloaded to a browser in a single HTTP transaction, greatly improving the download speed. The JAR format also supports compression, which reduces the file size, further improving the download time. In addition, the applet author can digitally sign individual entries in a JAR file to authenticate their origin. It is fully extensible."
Before going on in this tutorial, make sure that you have the JRE (Java Runtime Environment) version 1.5 or higher installed, and that you can launch "java" from the command line.
Before using Selenium RC from funittest, make the following test to see whether Selenium RC is capable of launching a browser:
cd selenium-remote-control-<VERSION>/selenium-server-<VERSION> java -jar selenium-server.jar -interactive
Try opening Firefox
cmd=getNewBrowserSession&1=*firefox&2=http://plone.org
or Internet Explorer
cmd=getNewBrowserSession&1=*iexplore&2=http://plone.org
A common problem is that Selenium RC can't find the binary of Firefox. The following error message should appear in the Selenium RC interactive session:
java.lang.RuntimeException: Firefox couldn't be found in the path! Please add the directory containing firefox.exe to your PATH environment variable, or explicitly specify a path to Firefox like this: *firefox c:\blah\firefox.exeAdapt the PATH variable and getting a new browser session should work just fine. If you wonder how to set the PATH variable on your system, check out the following howtos:
A new browser should have been launched by this command, and you should see a message like this at the end of the Selenium RC interactive session:
Got result: OK,699030 on session 699030
The session id needs to be used if you want to issue a command to Selenium RC using the following command:
cmd=open&1=http://plone.org&sessionId=699030
Use the exact session id (699030 in our case), and you will see the following output at the end of the Selenium RC interactive session:
Got result: OK on session 699030
The plone.org site should have opened in the browser.
To end the Selenium RC interactive session we issue the following command:
cmd=testComplete&sessionId=699030
The browser should have closed now.
Congratulations, you can be sure that funittest will be able to work properly with Selenium RC.
The Selenium RC server is started like this:
java -jar selenium-remote-control-<VERSION>/selenium-server-<VERSION>/selenium-server.jar
Funittest will talk to the Selenium RC server on port 4444 by default.If you can't get Selenium RC to run, have a look at the Selenium Remote: Control Troubleshooting FAQ.
Now that you have SeleniumRC running, you can go on learn about Testing with Funittest.