Let's talk about testing

Complete setup guide for Ruby, Cucumber and Watir or Selenium webdriver on Windows

This entry is part 3 of 11 in the series Test Automation
This blog post is outdated. Please refer to our updated setup guide instead.

Hi All,

We have seen quite some people having trouble getting a proper test automation setup using cucumber and watir-webdriver or selenium-webdriver. Here we describe the minimum number of steps to get your cucumber with watir/selenium-webdriver up and running.

Step 1 – Install Ruby

Download and install rubyinstaller-1.9.2-p180.exe.


rubyinstaller-1.8.7-p334.exe would also work

Step 2 – Extract DevKit

Download and extract DevKit-tdm-32-4.5.1-20101214-1400-sfx.exe to a folder you like.


Make sure you create a new folder, it extracts the lib and bin folders to that location, there is no root folder such as DevKit for example.

DevKit is needed because Cucumber requires the json gem. Without installing DevKit you would get the error:
ERROR: Error installing cucumber:
The 'json' native gem requires installed build tools.

Please update your PATH to include build tools or download the DevKit
from '' and follow the instructions
at ''

Step 3 – Install DevKit

Goto the root folder where you extracted DevKit and execute the commands:

ruby dk.rb init
ruby dk.rb install

Step 4 – Install the required gems


gem update --system
gem install rspec --no-ri --no-rdoc
gem install win32console --no-ri --no-rdoc
gem install watir-webdriver --no-ri --no-rdoc
gem install cucumber --no-ri --no-rdoc


  • Installing rspec because it is a commonly used gem.
  • win32console supports colored output on the dos command line when executing the tests!
  • watir-webdriver requires selenium webdriver, so that one will be installed always. If you only want selenium-webdriver, just do gem install selenium-webdriver instead.

When creating an install_gems.bat file inlcuding these commands, make sure to use the CALL command, e.g:

CALL gem update --system
CALL gem install rspec --no-ri --no-rdoc
CALL gem install win32console --no-ri --no-rdoc
CALL gem install watir-webdriver --no-ri --no-rdoc
CALL gem install cucumber --no-ri --no-rdoc

Step 5 – Start with your Cucumber and Webdriver setup

New to cucumber? Have a look at our Web Testing With Cucumber blog!

6 responses to “Complete setup guide for Ruby, Cucumber and Watir or Selenium webdriver on Windows”

  1. geshuni says:

    Thank you a lot, mate. Really useful info. I was able to run rails under win7 =)

  2. Good post! Congratulations!

  3. Anil says:

    thank you man!! useful at a right time

  4. Nate says:

    Where’s the rest? It stops at the beginning of step 5… Checked the link and it does not include a Complete setup for Cucumber and Watir-webdriver…. This guide only tells us how to install them… which i’ve already done…

  5. Abrahim says:

    very nice post..very helpful

  6. Sameer Sawant says:

    Selenium-cucumber is a behavior driven development (BDD) approach to write automation test script to test web applications.

Reputation. Meet spriteCloud

Find out today why startups, SMBs, enterprises, brands, digital agencies, e-commerce, and mobile clients turn to spriteCloud to help improve their customer experiences. And their reputation. With complete range of QA services, we provide a full service that includes test planning, functional testing, test automation, performance testing, consultancy, mobile testing, and security testing. We even have a test lab — open to all our clients to use — with a full range of devices and platforms. Discover how our process can boost your reputation.

We use cookies to give you the best browsing experience possible. For more information, please read our cookie policy.

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.