Configure Selenium Webdriver With Ruby
Step 1 : Download Ruby from http://www.ruby-lang.org/en/downloads/
Step 2: Install Ruby
Step 3: Verify Ruby Version
Open Start->Interactive Ruby
Write command RUBY_VERSION
Step 4: Download Selenium- Webdriver gem from http://rubygems.org/gems/selenium-webdriver
Step 5 :Install Selenium Webdriver Gem :
2. Navigate to folder where gem is downloaded using cd
(Example cd c:\Users\Downloads)
3. Write command gem install selenium-Webdriver
Step 5: Execute Webdriver script in Ruby
There are different ways to execute script
1. Write ruby code in notepad and save it with .rb extension and Run from Command Line
-Paste following code in notepad and save as “Test.rb”
driver = Selenium::WebDriver.for :firefox
element = driver.find_element(:id, "sb_form_q")
element.send_keys "Test Automation!"
puts "Test Completed"
-Navigate to folder where .ruby file is installed
-Write ruby Test.rb
2. Open Start->Interactive Ruby
Paste following code in ‘interactive Ruby’ Window
Note: for Ruby Scripting many tools are available like RDE, Ruby IDE etc.
Also Eclipse can be used for Ruby Scripting by adding some plug-ins.