Automated testing with Selenium IDE
Automated testing is an extremely useful bug-killing tool for the modern Web developer and a lot of vulnerability in fact are based on bugs.
With Selenium IDE, a free Firefox extension, you can easily record your clicks and inputs in the browser, set tests and replay the records. If a test failed you get a feedback.
I’ll show you an example, to make the power of Selenium clearer.
This example code echoes a form value.
<input type=”text” name=”name” value=”" />
<input type=”submit” value=”send” />
</form>
<? echo $_GET['name']; ?>
Start selenium and make sure the record lamp (red) is on. All steps will now record as long as the lamp is on.

Send a string “bla” over the form

Mark the output “bla” and choose in the right mouse context “verifyTextPresents bla”.
This is a testcase that “bla” is on the site displayed.

Go back to the selenium window and stop the recording (click on the red lamp).
Now it’s possible to run a playback of the recording, in 3 tempos (Run, Walk, Step), by pressing the green play button.

Ok time for a bug, change the variable name in the php line from “name” to “foo”
<input type=”text” name=”name” value=”" />
<input type=”submit” value=”send” />
</form>
<? echo $_GET['foo']; ?>
now we run a test in selenium and get a red marked error, because selenium doesn’t found the string “bla”.

This is only a bit of the power from Selenium. You can also debug with breakpoints, save tests in a lot of formats, edit the tests by hand, …
website: http://www.openqa.org/selenium-ide/
example video: http://wiki.openqa.org/display/SIDE/Recording+a+Test
3 comments so far
Leave a reply
Real helpful man! I needed to test a page I had written in asp.net, and having heard of Selenium I downloaded it, but didn’t know how to work with it. Until I came around your blog…
Thanks!
It s nice for frontend Testing where you watch but for real automated one it seems to be not usable yet
The extension is very useful. Use it to automate some your tests and you will save a lot of your time.