Selenium webdriver, chromeDriver and Ruby on Windows

Amanda Cavallaro
Jul 20, 2017 · 2 min read

Automating tasks you have to do over and over can be very helpful. I have been doing that on MacOS but I had the need to do it on a Windows OS and the online tutorials were not very helpful.

Illustration of a non-helpful tutorial statement

Selenium is an open-source tool used to automate browsers. Their official website contains tutorials and code snippets in various programming languages: java, csharp, python ruby, php, perl and javascript.

Below you can find a script for MacOS and Windows on how to install Selenium-web driver, Chrome Driver and Ruby. Please note I chose a specific version for each, but feel free to pick the one that makes more sense to you.

MacOS Tutorial on how to install what is listed on the title of this article.

#!/usr/bin/env bash
#!/usr/bin/env ruby
xcode-select — install
/usr/bin/ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
curl http://chromedriver.storage.googleapis.com/2.24/chromedriver_mac64.zip > /tmp/give_this_file_a_more_creative_name.zip
unzip /tmp/give_this_file_a_more_creative_name.zip -d /tmp
sudo gem install selenium-webdriver

This link is very helpful in order to put ChromeDriver location in your PATH environment variable: http://www.kenst.com/2015/03/installing-chromedriver-on-mac-osx/

Windows Tutorial

  1. Download chromedriver_win32.zip https://chromedriver.storage.googleapis.com/index.html?path=2.30/
  2. Install Ruby version e.g — 2.2.6 https://rubyinstaller.org/downloads/
  3. In order to put ChromeDriver location in your PATH environment variable do as follows:

Right click computer > properties > system properties >

Advanced > System properties > select Path below > edit > add the path

(if you are not sure of the path, you can right click the icon of the file and in the properties get the full path).

This video is very helpful to see this step-by-step however it is of an older windows versions, so you have to adapt to the one you’re currently using. https://www.youtube.com/watch?v=9kWz5tL4D7w

Extra

My favourite selenium resources when studying selenium with Ruby:

  1. A free, once-weekly e-mail on how to use Selenium like a Pro

2. Cheatsheet: https://gist.github.com/huangzhichong/3284966

About me

I am a computer scientist, currently working as a software developer. I am also involved in tech communities — I am Women TechMakers lead and a GDG Cloud London organiser.

If you would like to find me on social media:

www.twitter.com/chibichibibr
https://www.facebook.com/amandawtm/

The GDG Cloud London group I co-organise

gdgcloud.slack.com
www.twitter.com/gdgcloud
https://www.facebook.com/gdgcloudlondon/
www.meetup.com/gdgcloud

)

Amanda Cavallaro

Written by

Software developer, passionate about Cloud technologies, Human Computer Interactions and Chatbots. Women Techmakers, Japanese Culture lover, Aikidoka.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade