Friday, 19 December 2008

How to run Selenium-RC in a virtual machine

A tale of VMWare vs VirtualPC
One issue that I have with selenium and running tests through IE is the little popup dialog saying "The web page you are viewing is trying to close the window. do you want to close this window?"
Our tests use openWindow and then close them frequently.
I wrote a little AutoIt script to sit in the background and poll for that dialog and close it when it appears.
But sometimes the AutoIt script makes it difficult for me to use the PC at the same time as the scripts run, so I decided to use VirtualPC to run the Selenium-RC server. And that would surely solve my problems? But oh no, then my problems really began...

Wednesday, 17 December 2008

Selenium and HTMLUnit - the abstraction layer


I once did an experiment to see how easy I could wrap HTMLUnit with  Selenium for automated software testing.
In my experiment I created a wrapper by extending the DefaultSelenium class and then using eclipse to create wrapper functions for all the methods. Then inject that HTMLUnitSelenium class into my abstraction layer and voila - your Selenium tests run with HTMLUnit (*cough* well, in theory).
Then I recently discovered that someone else had done the same thing. Frank Cohen, at a recent workshop, mentioned a wrapper that already existed in PushToTest.
So I hunted it out, and I tried to use it...

>