Skip to content

Ruby + Watir

Ruby is a very easy to understand program language. Watir is a gem (plugin/extension/library) for Ruby which allows you to control the browser. These two go very well hand in hand with Cucumber and RSpec.

Ruby

Ruby is a widely used webdevelopment language (Ruby on Rails). Besides that, i.c.w. Ruby and Cucumber website test automation is easy.

Installation on Windows

Download and install the latest from Rubyinstaller.org. During the installation mark all checkboxes (especially PATH & Devkit).

Installation on Linux

Usage

  • gem install update
  • gem install upgrade

Validate installed version

Open a command prompt and type ruby --version
When installed correctly you get something like ruby....

Basic commands

Learn some Ruby basics in 20 min.

Watir

Watir is a gem for Ruby which focus is browser automation. A Ruby gem can be described as a plugin or library. Meaning, if you don't use it, you could still do browser automation. But sooner or later you will write functions/classes/methods that are already available in Watir.

Install Watir

Open a command prompt and type gem install 'watir'
Thats all, you are ready to go!

Usage

For using Watir I'll add some exampls soon. In the meantime check the website https://www.watir.com