TA Basics: Test Framework on Linux (or VM)

At some point I messed up my local test automation setup and I thought, maybe I should do the experimental things in a Virtual Machine. So here is a compact manual for a Ubuntu VM.



For the VM I'm using the open source software VirtualBox from Oracle. There are plenty of manuals for that around on the internet. So I'm not going to cover how to install Virtual box with Ubuntu.  www.virtualbox.org

But what I want to cover in this manual is an editor (Visual Studio Code), Ruby, a set of ruby gems (lapis_lazuli, Watir, Selenium-webdriver) and of course the webdriver itself (Geckodriver).

So let's get started.

Visual Studio Code installation

Download the package from https://code.visualstudio.com/
I downloaded the 32bit debian version from https://code.visualstudio.com/docs/?dv=linux32_deb
After that I followed the guide on https://code.visualstudio.com/docs/setup/linux
sudo apt install ./<file>.deb

Ruby + gems installation

In the terminal:
sudo apt install ruby-full
sudo gem install 'lapis_lazuli' (this will also install watir & selenium-webdriver

Geckodriver

Get the latest from https://github.com/mozilla/geckodriver/releases
Extract the geckodriver
chmod +x geckodriver
sudo mv geckodriver /usr/local/bin/

Let's see if everything works

cd ~/
mkdir testautomation
cd testautomation
lapis_lazuli create testframework
cd testframework
cucumber
If everything went smooth, you will see Firefox starting up, Cucumber running the tests and at the end showing you the results. 

Common errors

Stack to deep errors mean you most likely cannot access the webdriver (it's either missing, or not in correct folder, or the folder is not in your PATH).



Comments

Popular posts from this blog

PowerShell - How to overcome Azure VM's fixed resolution limitation

TA Basics: Website Test Automation on mobile devices via Appium server

TA: Who doesn't like proxies? Me!