
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Use Selenium with Ruby
We can use Selenium with Ruby. First of all we have to install Ruby in the system. For installation in Windows, we have to take the help of the RubyInstaller package by navigating to the link −
https://rubyinstaller.org/
Click on Download.
The various versions of Ruby Installers links get displayed. Select the latest version and click on it.
Click on the Save File button to download the corresponding rubyinstaller.exe file.
Once the download is completed, accept the license agreement and proceed to the next steps till installation is completed.
To have Selenium webdriver package for Ruby, run the command −
gem install selenium−webdriver
To have Rest−Client package for Ruby, run the command −
gem install rest−client
To have test−unit package for Ruby, run the command −
gem install test−unit
Example
#set webdriver gem for Selenium require "selenium−webdriver" require "rubygems" #driver object creation driver = Selenium::WebDriver.for :chrome #launch browser driver.navigate.to "https://www.tutorialspoint.com/index.htm" #close browser driver.close
Advertisements