CHAPTER 18 ■ TESTING WITH PHPUNIT
Selenium RC requires a more manual approach. Once you’ve downloaded the package, you should
find an archive called selenium-remote-control-1.0.3.zip (though, of course, your version number will
probably be different). You should unzip this archive and look for a jar (Java ARchive) file somewhere
like selenium-server-1.0.3/selenium-server.jar. Copy this file somewhere central. To proceed
further, you’ll need need Java installed on your system. Once you’ve confirmed this, you can start the
Selenium Server.
Here, I copy the server to a directory named lib in my home directory. Then I start the server:
$ cp selenium-server-1.0.3/selenium-server.jar ~/lib/
$ java -jar ~/lib/selenium-server.jar
13:03:28.713 INFO - Java: Sun Microsystems Inc. 14.0-b16
13:03:28.745 INFO - OS: Linux 2.6.31.5-127.fc12.i686 i386
13:03:28.787 INFO - v2.0 [a2], with Core v2.0 [a2]
13:03:29.273 INFO - RemoteWebDriver instances should connect to:
http://192.168.1.65:4444/wd/hub
13:03:29.276 INFO - Version Jetty/5.1.x
13:03:29.284 INFO - Started HttpContext[/selenium-server/driver,/selenium-server/driver]
13:03:29.286 INFO - Started HttpContext[/selenium-server,/selenium-server]
13:03:29.286 INFO - Started HttpContext[/,/]
13:03:29.383 INFO - Started org.openqa.jetty.jetty.servlet.ServletHandler@b0ce8f
13:03:29.383 INFO - Started HttpContext[/wd,/wd]
13:03:29.404 INFO - Started SocketListener on 0.0.0.0:4444
13:03:29.405 INFO - Started org.openqa.jetty.jetty.Server@192b996
Now I’m ready to proceed.
Creating a Test
Selenese, the Selenium language, is simple but powerful. There’s nothing to prevent you from
authoring tests in the traditional manner, with a text editor. However, the Selenium IDE is by far the
easiest way into testing. You can launch it from the Tools window.
Once you have the control panel up, you should add an address to the Base URL field. This should
be the address against which relative links will work in the system under test. You should see a red dot
on a button in the right-hand corner of the IDE control panel. It should be depressed, which means the
tool is already in record mode.
Figure 18–1 shows the IDE as it should be at this point.