Selenium Quick Start

Selenium Quick Start

There are a bunch of different guides that talk about how to set up a computer for Selenium testing and developing. All of the guides tell you how to setup but they do not show you the most efficient way to not just install but for maintenance later on. Read on for the way that I find not just easy but nearly foolproof setup.

So this is essentially reiterating a previous article about package managers. However the point is still important.

These scripts are from my Basic Selenium Java Project that is available on GitHub. That is a sample project that allows anyone to quickly setup their machine and validate that selenium tests can run on it.

So here are the install scripts for Windows and Mac OS:

Mac

This install script also installs Homebrew the package manager for Mac OS so that it is easy to upgrade to the versions that you want to install.

#!/usr/bin/env bash
set -ev
brew install geckodriver
brew cask install firefox
brew install chromedriver
brew cask install google-chrome
brew install phantomjs

Windows

This install script uses Chocolatey to manage the different versions of the browsers and Selenium drivers. The last line of this install script adds location of the drivers to the PATH environment variable so that and language you use can utilize the drivers without having to declare them in the solution.

@echo off
title Setting up your machine for Selenium Testing!

@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"

choco install firefox -y
choco install googlechrome -y
choco install phantomjs -y
choco install selenium-all-drivers -y
choco install jdk8 -y
choco install maven -y
SETX PATH "%PATH%;C:\tools\selenium"
Andrew Krug's Picture

About Andrew Krug

Automation consultant helping you deliver greatness effectively.

New York, USA http://andrewmkrug.com

Comments