Friday, 25 April 2014

Getting started with Ruby | Selenium Users


Note|  Text in Blue [#PYTHON], Red [#RUBY], and Orange [#JAVA] can be edited or mentioned important for the entire blog. All the posts are practically done by me.


Ruby Installation


In Windows, you can use either RubyInstaller or pik.

1| Download rubyinstaller
2| Check Ruby version
Start > Interactive Ruby
RUBY_VERSION



3| Install Selenium WebDriver library for Ruby
selenium-webdriver-2.41.0.gem
INSTALL > gem install selenium-webdriver



4| Download Devkit before installing json
5| Extract DevKit to path C:\Ruby200\DevKit
6| Open cmd prompt
> cd C:\Ruby200\DevKit
> ruby dk.rb init
> ruby dk.rb review
> ruby dk.rb install


INSTALL > gem install json



7| Download Ruby DLTK plugin for Eclipse IDE [Go to Eclipse Marketplace and search Ruby DLTK]



8| Go to Windows > Preferences > Ruby - Interpreters



9| Click on 'Add' and Locate Ruby.exe  "C:\Ruby200\bin\ruby.exe"



10| Create a New Ruby Project
Right click on package Explorer > New > others 

11| Type 'Ruby'.
12| Select 'Ruby Project' and press Finish.



13| Create a new Ruby module.
Right click on package > New > Ruby module

14| Develop your Ruby selenium script like sample given below

require "selenium-webdriver"

driver = Selenium::WebDriver.for :firefox
driver.navigate.to "http://google.com"

element = driver.find_element(:name, 'q')
element.send_keys "Prashanth Sams"
element.submit

driver.quit

15| Rick click on program Run > Ruby Script



Note| 
1| Rack is a web server interface used for developing web applications in Ruby; Rack is used by almost all Ruby web frameworks and libraries, such as Ruby On Rails and Sinatra.
2| RubyGems is a package manager for Ruby programming language.

13 comments:

  1. Hi
    i dont have the build.xml on my project i just have the testNg.xml
    i need to creat it ??

    ReplyDelete
  2. It was very nice article and it is very useful to Selenium learners.We also provide Cub training software online training.

    ReplyDelete
  3. Thanks for the great information in your blog Selenium Training in Chennai

    ReplyDelete
  4. Well explained. Got to learn new things from your Blog on Appium.
    Appium training in chennai

    ReplyDelete
  5. Thanks for sharing great information in your blog. Got to learn new things from your Blog . It was very nice blog to learn about Selenium.selenium training in chennai

    ReplyDelete

  6. Thanks for posting this useful content, Good to know about new things here, Let me share this, . VMWare training in pune

    ReplyDelete
  7. Advanced Selenium Framework Training in Chennai by Vishwa

    Hi, Reach Mr.Vishwa for Best Selenium and Coded UI Training in Chennai with real time project assistance. This people will teach everything from the basics up to advanced level scenarios from frameworks.

    I learned from Mr.Vishwa and Raj they are very good automation people for Selenium Frameworks. After joined with them I learned many things and now I am writing automation scripts in own project. Vishwa 9003085882
    selenium training in chennai

    ReplyDelete
  8. Interest to learn Selenium Online Training by Real Time Software Testing Professional Trainer having 10+ Years of Expert.
    Selenium Training in Hyderabad

    ReplyDelete
  9. It was very nice blog to learn about Selenium.Thanks for sharing new things.selenium training in chennai

    ReplyDelete
  10. Thank You for sharing your article. I like it. We are also giving TIBCO Online Training at affordable prices.

    ReplyDelete
  11. Great site for these post and i am seeing the most of contents have useful for my Carrier.Thanks to such a useful information.Any information are commands like to share him.
    Selenium Training in Chennai

    ReplyDelete
  12. Hi,

    i am learner of selenium,this post is very useful for me thank you

    ReplyDelete