The Sounds of Selenium Testing Your Weblickation #
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?
Jon Tirsen
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…
<|:{
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
messages
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
Jared
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
Alexey Verkhovsky
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.
Bret
Ways to Integrate Watir and 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.
Jason Huggins
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…
...Or…
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.