hoodwink.d enhanced


The Sounds of Selenium Testing Your Weblickation #

by why in inspect

I just got a note from Luke Closs about a podcast where he talks about Selenium, a tool for automated testing of your web project. I know this is Watir territory, but Watir only does IE, right? I wonder if we could see some symbiosis here?

said on 02 Nov 2005 at 18:57

There is a Ruby to Selenium bridge lying around somewhere. Basically you can write tests for Selenium with Ruby just like Watir. Ruby enqueues commands on the server and the Selenium test runner picks them up and runs with them.

It’s not really actively maintained at the moment so if anyone’s interested…

said on 02 Nov 2005 at 20:43

The Sounds of Selenium (sung o the tune of Simon & Garfunkle’s, Sounds of Silence):
“Hello browser my old friend,
I’ve come to test my site again
Because a bug softly creeping,
Left its seeds while I was coding,
And the bug that was planted in my web-app
Still remains…
I hope to find it with the help of selenium.

In sleepless dreams I test alone
In a tiny cube my nose to the grindstone,
‘Neath the glow of flourecent lights,
I turned up the brightness on my CRT
When my eyes were stabbed by the red flash of error
That spit out all night
And ruined my dinner plans…

And in the logs I saw
Ten thousand hackers, maybe more.
Hackers buying without money,
Hackers seeing what they shouldn’t see,
Hackers writing code that should never be run
And no one dared
Disturb the sound of my utter dismay…

“Fools!” said I, “You do not know
Those SSN ’s are fake
Take my credit card numbers that I might catch you,
Take my bait that I might teach you.”
But my words like silent office fell,
And echoed
like comments in old code

And the hackers bowed and played
Through the backdoors they had made.
And the warning message flashed out its warning,
In the words that it was forming.
And the message said, “The server is busy
please try again later”
And whisper’d in the sounds of slashdotting

said on 02 Nov 2005 at 21:59

Brett Pettichord (a contributor to both Watir and Selnium) apparently wants to eventually have Watir use Selnium for driving other browsers in addition to IE: Watir and Selenium by Brett Pettichord

said on 03 Nov 2005 at 22:00

I’ve spoken to Paul Rogers couple of days ago, and he didn’t sound very optimistic about it, mainly because Selenium runner must live on the web server (to bypass the cross-site scripting block), which is a scenario many Watir users cannot do.

said on 03 Nov 2005 at 23:13

Ways to Integrate Watir and Selenium

  1. Use the Ruby Selenium Bridge that Jon mentioned. It’s included in the Selenium distribution.
  2. Use the RubySelenium package that Kingsley’s been working on.
  3. Or build a pluggable backend to Watir that, instead of driving IE/COM, generates Selenium HTML tables. Then you can feed these to Selenium.

Paul is right. Many users are put off by the requirement that the Selenium runner live on the webserver. But none of these approaches would require this—until you needed to test on FireFox. At that point, what other choice would you have. If they need to test FireFox or Mozilla or Safari, they’ll find a way to install Selenium on the server—if one of the integrations outlined here has been implemented.

Kingsley and Paul have seperately been threatening to create an alternate Mozilla/XCOM plug in for Watir to give us an alternate solution for cross-browser testing with Watir. That would work for me too.

said on 04 Nov 2005 at 09:01

Selenium does not have to be installed on the server, but that is the easiest way to deploy it. It’s all about getting around the “same origin” policy enforced by the server. You can either have Selenium and your APP running on the same domain and port…


Turn off the “same origin” security policy in your browser. In Internet Explorer, you can run Selenium’s TestRunner as an “HTA” (HyperText Application). In Firefox, install the SeleniumRecorder extension which runs as a trusted extension.

With an HTA or the Firefox extension, you do not need to install anything on the server. Selenium’s engine and your tests can live on the local filesystem and you can test any non-local server.

Yes another way to run Selnium without requiring a server-side installation is to use the “standalone” version of Selenium. It’s deployement is similar to Watir—it runs on your client and you can test any non-local server. The advantage over Watir is that scripts can be in any language with an XML -RPC client library (Perl, Java, Ruby, Python, etc.) and can test any browser supported by Selenium (IE, Firefox, Mozilla, Safari, Konq)

Comments are closed for this entry.