How to run Selenium RC with Ruby codes

1. Download seleniumRC from –>

2. Unzip the file

3. commans prompt>java -version  –> Version should grater than 1.6.0_5

4. command prompt go to –> C:\selenium-remote-control-1.0.1\selenium-server-1.0.1>java -jar  selenium-server.jar

Now Selenium runs on 4444 port.

5.  a)Download and install Ruby from

b) cmd prompt>gem install selenium-client


i) Go to

ii) Click Download and save the GEM file in C:\ruby\bin\

iii) Cmd Propmt –> C:\ruby\bin>gem install GEMNAME


6. Open new command prompt and goto ruby program path.In Ex, c:\test>ruby code.rb

7.  code.rb

require “selenium/client”
require “test/unit”

class Untitled < Test::Unit::TestCase
def setup
@verification_errors = []
if $selenium
@selenium = $selenium
@selenium =“localhost”, 4444, “*chrome”, “;, 10000);

def teardown
@selenium.stop unless $selenium
assert_equal [], @verification_errors

def test_untitled “/” “link=jazzez-news.exe released (using Mechanize – ruby gem)”
@selenium.wait_for_page_to_load “30000” “link=exact:;

8. Selenium RC will give some outputs in new firefox window.

Any more details need then just ping me at


5 thoughts on “How to run Selenium RC with Ruby codes

  1. HI

    I am Naveen.I had learnt ,how to run selenium IDE & selenium RC.The main thing is how to generate a Test Report after the running the test Succesfully.And another thing is How to run Selenium Core and when it is useful .And suggest me some more open source tools for testing .Net and Java Projects ………………………..

    Try to help me…..


  2. Hi Ravee,
    It is really nice to know the difference and advantage between Watir and Selenium.
    Thank you for your hard work and info sharing.
    Wish you the very best!

  3. hi ravee,

    Can you help me? How to change “def test_untitled” to some other name eg. def my_test

    How to define multiple tests and set their context in a single test.

  4. Hi all,

    I’m studying Selenium RC that use by Ruby.
    When I run “java -jar selenium-server.jar” command. It shows warning as

    “Failed to start: SocketListener0@
    Exception in thread “main” Selenium is already running on port 4444. Or some other service is.”

    From the warning, it could work or not.

    Thank you so much.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s