Complete Mac Setup Guide for Ruby+Cucumber+Watir/Selenium

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

Step 1 – Install RVM & Ruby

RVM is used to manage multiple release of Ruby.

curl -L get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
$ rvm list known
$rvm install 1.9.3
# This installs Ruby 1.9.3
Step 2 – Install the required gems

Execute:

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

Explanation/details:

– Installing rspec because it is a commonly used gem.
– 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.sh file inlcuding these commands, e.g: gem update –system

 gem install rspec --no-ri --no-rdoc
 gem install watir-webdriver --no-ri --no-rdoc
 gem install cucumber --no-ri --no-rdoc

Step 4 – Start with your Cucumber and Webdriver setup

Requirement: you need to have Xcode and Git setup already.

Follow this to set up Cucumber and Webdriver.

Advertisements

5 Responses to Complete Mac Setup Guide for Ruby+Cucumber+Watir/Selenium

  1. Rich says:

    Any plans to finish this tutorial?? Step 4?

  2. Dean says:

    When I ran curl -L get.rvm.io | bash -s stable on Mac, I am getting the following error message.
    “0curl: (7) Failed to connect to 2607:f700:1:b7:230:48ff:fe34:395f: No route to host”

    I think it’s because of proxy. I was able to manage install everything on Windows using the command Set HTTP_PROXY. Just wondering how I can do this on Mac as I need to have Cucumber installed on both Win and Mac.

    Thanks.

  3. Mohsin Ali says:

    Please run “rvm use ” for specify the ruby version, if there are many previous version present in the system.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: