Installing RSelenese in Selenium IDE

Posted by Alvin Lai on October 30, 2009

Selenium on Rails is just plain awesome, providing an web testing interface that doesn’t interfere with your main code. That said, there’s a Firefox plugin called Selenium IDE that records your actions in Firefox and generates tests for use with Selenium, how cool is that!

The only problem is, Selenium IDE doesn’t output in RSelenese and having to port one of their supported formats (Ruby Selenium) is a pain. So what do you do? Install the RSelenese plugin of course!

Here are the steps:

35aaa9dae09704b6186bf35f150277c2

F1b862385d68c472b8a0dca4758cd1cf

Then paste the following code:


/*
* Selenium on Rails RSelenese format for Selenium IDE
*
* Written by Shinya Kasatani (kasatani at gmail.com)
*/

load('formatCommandOnlyAdapter.js');

function string(value) {
if (value != null) {
value = value.replace(/\\/g, '\\\\');
value = value.replace(/\"/g, '\\"');
value = value.replace(/\r/g, '\\r');
value = value.replace(/\n/g, '\\n');
return '"' + value + '"';
} else {
return '""';
}
}

function underscore(text) {
return text.replace(/[A-Z]/g, function(str) {
return '_' + str.toLowerCase();
});
}

function formatCommand(command) {
var line = underscore(command.command);
if (command.target) {
line += ' ' + string(command.target);
if (command.value) {
line += ', ' + string(command.value);
}
}
return line;
}

this.playable = false;

(Taken from http://wiki.openqa.org/display/SIDE/SeleniumOnRails)

here:

39603dd88dd72866cfb0e2d5b074ff32

If you’d wanna tweak the generated RSelenese code, here’s a handy reference:

http://svn.openqa.org/fisheye/browse/~raw,r=1000/selenium-on-rails/selenium-on-rails/doc/classes/SeleniumOnRails/TestBuilder.html

Enjoy! :)

Get to know new music 1

Posted by Alvin Lai on May 28, 2006

I’m not sure if it’s the case for most of you, but I’ve found it increasingly difficult to get to know new music.

Maybe I’ve grown out of techno. I need a breather from classical.

Maybe a friend has sent you a single song that you really like but don’t know where of that came from.

Sure you could check out the other songs from the same artist. But what if you could get to know new songs that feel similiar?

In comes Last.FM

The sky got a little clearer when I finally stumbled back on Last.fm. A webservice that introduces music based on similar artists you specifiy.

Correct me if I’m wrong, but you could only listen to a limited number of 30 second samples from the website when you search for an artist.

And you even have to sign up to preview the 30second tracks. Oh well, I signed up grudgingly and guess what I stumbled on?

A Last.FM Player application download!

It recommended me the Mac OSX version, but there are also Windows (maybe Linux) versions for download too.

And what does it do?

Search for an artist and it plays FULL length tracks of similiar music!

Such a godsend. :D

Searched for Stevie Ray Vaughan and what did it get me? Led Zepplin Stairway to heaven, another of my favourites.

Found another nice band!

The Allman Brothers Band – In Memory of Elizabeth Reed.

Anyone has the CD? :D

Enjoy!

Free paypal fee calculator 1

Posted by Alvin Lai on May 20, 2006

Useful for all you ebay fanatics out there – you know who you are! grin

PP Calc