In this
article we are going to learn how to setup Selenium with Ruby,
our tests will be written in Ruby while interfacing to Selenium’s API
through ‘Gems’
on top of a specific IDE.
These are
the steps to run a test in Selenium with Ruby using eclipse IDE:
- Download and install Ruby.
- Install Java (Optional but recommended for eclipse)
- Install Eclipse IDE.
- Configure Ruby with Eclipse.
Download and install Ruby
There
are number of ways to install ruby, but in this article, we will use simplest
way i.e. Ruby installer. To download ruby installer, enter: https://rubyinstaller.org/downloads/ and download the latest version of ruby and install it on your machine.
To know how to install ruby and set environment variable for ruby in details, enter: https://programmingyouself.blogspot.com/2018/09/how-to-install-and-set-environment.html
When
installation is over, go to the “C:” drive and notice a new library is created
like – “Ruby25-x64” (Here number indicates the version of the ruby)
Download & Install Java (Optional but recommended for eclipse)
To download and install latest version of Java, enter: http://www.oracle.com/technetwork/java/javase/downloads/jdk10-downloads-4416644.html
Download & Install Eclipse IDE
To download and install latest version of Eclipse, enter: https://www.eclipse.org/downloads/
Here installation is over now launch the Eclipse by clicking eclipse Icon
Here our eclipse is launched successfully now its time for configuring ruby with eclipse
Configure Ruby with Eclipse
To configure ruby with eclipse Click
on “Help=> Install new Software”
Now Select
All Available Sites (This process takes time)
Now Search
for “Programming languages” and expand it
Now Search
for “Dynamic Languages-Toolkit- Ruby Development Tools”, select it and click
on “Next” button
At this
point wait until installation finished and restart Eclipse
Now we must
configure Ruby’s interpreter that will be working with Eclipse. For this
click on “Windows=>Preferences” and choose Ruby’s Libraries
Now Click
on “Ruby=>Interpreter=>Add”
Now Click
on “Browse” option, go to Ruby’s bin folder, select “ruby.exe” file and click
on “OK” button.
Here our ruby is configured with eclipse for automation script now we can start scripting.