Acceptance testing PHP using selenium

Friday, January 26th, 2007

As we are approaching the final stages of one of out projects, I have been doing some serious acceptance testing to make sure that the site is functioning correctly. To set the testing up, I was given a steer in the right direction and used the Seagull wiki as a guide for the installation….hat tip to Demian.

It is really easy to set the test suite up and to get going, all you really need are the following two downloads:

  1. Selenium core test suite
  2. To record tests the Selenium IDE in Firefox

Once you have installed the Selenium core web application and the plug-in for Firefox (Firefox rocks!!) you good to go:

  1. Plan the various tests which you would like to run
  2. Set the Firefox IDE to record your actions
  3. Once you’ve completed a certain test save the test in an .html file
  4. Include a link to your test file in your main index.html (TestSuite) file, which acts as a table of contents for the various tests
  5. Then you can either run the tests individually or as a batch

If you would like a more detailed tutorial, I found the one on the thinkPHP blog to be quite useful.

As Demian says, you start getting “addicted” to creating tests and eventually try to become a perfectionist - which is a good place to be in if you want to produce error free sites for clients.