1. Download the Ruby Installer – The Ruby Installer is currently available only for the Windows platform.
  2. Install the Ruby Installer by double slicking on the .exe file. A new Ruby folder is created in your C drive  C:\Ruby200-x64\
  3. Download Development Kit and Unzip the  Development Kit zip file
  4. Open command-line and go to unzipperd folder
  5. Execute the below commands from command line C:\Ruby200-x64\bin>gem install selenium-webdriver-2.35.0.gem
    ruby dk.rb init
    ruby dk.rb install
    gem install rdiscount --platform=ruby
    
  6. Download the selenium-client to C:\Ruby200-x64\bin.
  7. Execute the below command
    C:\Ruby200-x64\bin>gem install selenium-webdriver-2.35.0.gem
  8. Open a text editor and copy the following code and save the file as googlesearch.rb under your test script folder in this example D:\Personal\Ruby\Selenium
    require 'rubygems'
    require 'selenium-webdriver'
    driver = Selenium::WebDriver.for :firefox
    driver.get "http://google.com"
    element = driver.find_element :name => "q"
    element.send_keys "Cheese!"
    element.submit
     puts "Page title is #{driver.title}"
     wait = Selenium::WebDriver::Wait.new(:timeout => 10)
     wait.until { driver.title.downcase.start_with? "cheese!" }
     puts "Page title is #{driver.title}"
    driver.quit
    
  9. Run  googlesearch.rb file as shown below
    D:\Personal\Ruby\Selenium>ruby googlesearch.rb