Robot Framework and RIDE installation guide

keskiviikko 10. lokakuuta 2018

Robot Framework is an open-source generic test automation framework, developed by the Robot Framework Foundation (www.robotframework.org). RIDE is an integrated development environment developed for creating and managing Robot Framework test scripts. This guide shows how to install Robot Framework and RIDE and some of the most popular libraries, such as SeleniumLibrary and Chrome Webdriver tool for programmatic control of the Chrome browser.
This guide uses Windows Powershell, which can be found when using Windows search 'powershell'. This guide was made with Python 3.7.0. on Windows 10.

1. Robot Framework

# If you want to use a virtual environment for the installation, activate it first:
(devenv) PS C:\Users\tvirtane\Documents\devenv> .\Scripts\activate

# Install Robot Framework with pip:
pip install robotframework

# Verify the correct version of the installation:
(devenv) PS C:\Users\tvirtane\Documents\devenv> robot --version
Robot Framework 3.0.4 (Python 3.7.0 on win32)


2. RIDE

# Download Python 3 compatible version of RIDE from GitHub:
https://github.com/HelioGuilherme66

# Unzip .zip file to your /devenv/ folder

# Install wxPython (a requirement for RIDE):
pip install -U wxPython

# Install RIDE;
python3 setup.py install

# Click the created icon or start it from folder 'devenv' with command:
(devenv) PS C:\Users\tvirtane\Documents\devenv> ./Scripts/ride.py


3. SeleniumLibrary

# Install SeleniumLibrary for Robot Framework:
pip install robotframework-seleniumlibrary

 4. Chrome WebDriver

# Download the newest Chrome WebDriver 2.42 from:
http://chromedriver.chromium.org/downloads

# Unzip the chromedriver_win32.zip and move the 'chromedriver.exe' file to a folder:
C:\Python3\Scripts\

# Add this Chromedriver filepath to your PATH environment variable:
C:\Python3\Scripts\chromedriver.exe

# Guide for changing environment variables can be found here:
https://testaataiitke.blogspot.com/2018/10/python-3-installation-guide.html

Last updated 10.10.2018

Robot Framework ja RIDE asennusohje

Robot Framework on avoin testiautomaatiotyökalu, jota kehittää Robot Framework Foundation (www.robotframework.org). RIDE on Robot Frameworkin käyttöön kehitetty integroitu kehitysympäristö (Robot Integrated Development Environment), joka helpottaa testiskriptien kirjoittamista ja hallintaa. Tämän ohjeen tarkoituksena on asentaa Robot Framework, siihen RIDE kehitysmpäristö ja yleisimpiä kirjastoja, kuten SeleniumLibrary ja Chrome WebDriver -työkalun selaimen ohjelmalliseen hallintaan.
Tässä ohjeessa käytetään perinteisen komentorivin (command promptin, cmd) sijaan uudempaa Windows Powershellia, joka sisältää UNIX-tyyliset komentokäskyt, kuten listaa, ls. Eli avaa Powershell kirjoittamalla 'powershell' Windowsin hakuun ja paina Enter.

Ohje on tehty Python 3 käyttäen Windows 10 -käyttöjärjestelmää.

1. Robot Framework

# Mikäli haluat asentaa Robot Frameworkin virtuaaliympäristöön, aktivoi se ensin komenolla
(devenv) PS C:\Users\tvirtane\Documents\devenv> .\Scripts\activate

# Asenna Robot Framework käyttäen pip-työkalua komennolla:
pip install robotframework

# Tarkista asennettu versio (huomaa käytössä oleva virtuaaliympäristö):
(devenv) PS C:\Users\tvirtane\Documents\devenv> robot --version
Robot Framework 3.0.4 (Python 3.7.0 on win32)


2. RIDE

# Lataa Python 3:lle forkattu versio RIDEsta GitHubista:
https://github.com/HelioGuilherme66

# Unzippaa .zip-paketti /devenv/-kansioon.

# Asenna wxPython
pip install -U wxPython

# Asenna RIDE
python3 setup.py install

# Käynnistä kuvakkeesta tai 'devenv'-kansiosta komennolla:
(devenv) PS C:\Users\tvirtane\Documents\devenv> ./Scripts/ride.py


3. SeleniumLibrary

# Asenna SeleniumLibrary for Robot Framework kirjasto komennolla:
pip install robotframework-seleniumlibrary

 4. Chrome WebDriver

# Lataa uusin Chrome WebDriver 2.42 osoitteesta:
http://chromedriver.chromium.org/downloads

# Pura lataamasi chromedriver_win32.zip ja siirrä 'chromedriver.exe'-tiedosto kansioon:
C:\Python3\Scripts\

# Lisää tämä polku Windowsin PATH-ympäristömuuttujaan:
C:\Python3\Scripts\chromedriver.exe

# Ohjeet ympäristömuuttujien asettamiseen löytävät täältä:
https://testaataiitke.blogspot.com/2018/10/python-3-asennusohje.html

Päivitetty 10.10.2018

Python Virtualenv installation guide

Virtualenv is a tool for Python that allows the easy creation of virtual python environments. We can have multiple different Python environments with different Python modules.
For the installation, we will use pip, a packet management tool that was installed with Python 3.

Instead of the traditional command prompt (cmd), we will use the newer Windows Powershell, that contains more UNIX-like commands, like ls. This is a personal preference, of course. So, let's start by writing 'powershell' to the Windows search and press Enter.


And this is what it looks like:

Now we are ready to start installing virtualenv!

1. Go to your folder of choice, for example: 
cd C:\Users\myname\Documents\

2. Install virtualenv with command:
pip install virtualenv

3. Create a new virtual environment named 'devenv' with command:
virtualenv devenv

Now, you should have a folder named 'devenv' that has local copies of Python tools.

4. Lastly, you have activate the virtual environment in Powershell., by being in the folder /devenv/ and writing the command:
./Scripts/activate

You can see that the virtualenv is activated, when the name of the environment in shown in braces () before the command line, for example:
 (devenv) PS C:\Users\myname\Documents

Last updated 10.10.2018

Python Virtualenv asennusohje

Virtualenv on Pythonille tehty työkalu, jolla voi helposti ja luoda virtuaalisia pythonympäristöjä. Tällöin meillä voi olla samanaikaisesti useita eri projekteja, joissa jokaisessa on omat kirjastot ja riippuvuudet.
Virtualenv ei ole kriittinen, mutta se helpottaa erilaisten ympäristöjen hallintaa. Esimerkiksi, jos asennat Robot Frameworkin suoraan ilman virtualenvia, niin se menee automaattisesti Python asennuksen oletuskansioon, eli esim. C:\Python3\. Jos taas olet virtuaaliympäristön sisällä ja asennat Robot Frameworkin , menee asennus kyseisen virtuaaliympäristön Python asennuskansioon.

Virtualenvin asennukseen käytettään pip-työkalua, joka asentui Python 3:en mukana.

Käytetään perinteisen komentorivin (command promptin, cmd) sijaan uudempaa Windows Powershellia, joka sisältää UNIX-tyyliset komentokäskyt, kuten ls. Eli avaa Powershell kirjoittamalla 'powershell' Windowsin hakuun ja paina Enter.

Ja tältä se näyttää:

Nyt voimme aloittaa virtualenvin asennuksen haluttuun kansioon,
esim.: C:\Users\myname\Documents\

1. Mene haluttuun kansioon komennolla cd (sanoista change directory):
cd C:\Users\myname\Documents\

2. Installoi virtualenv Pythonille komennolla:
pip install virtualenv

3. Luo uusi virtuaaliympäristö nimeltä 'devenv' komennolla:
virtualenv devenv

Nyt devenv-kansiossa on omat paikalliset versiot Pythonin tarvittavista utility-työkaluista.

4. Aktivoi virtuaaliympäristö Powershellissä, olemalla kansiossa /devenv/ ja kirjoittamalla komento:
./Scripts/activate

Komentorivin alussa pitäisi nyt lukea suluissa (devenv) PS C:\Users\myname\Documents,
joka kertoo, että virtuaaliympäristö on käynnissä. Kaikki komennot, jotka nyt suoritetaan, suoritetaan kyseisen virtuaaliympäristön Python-kirjastoja käyttäen.

Päivitetty 10.10.2018

Python 3 installation guide

1. Navigate to: https://www.python.org/downloads/ and download the newest version of Python 3.7.0. for your operating system. This guide uses Windows 10.
2. Start installation by clicking the python-3.7.0.exe

Here you can add Python to your Windows Environment variable PATH by clicking the lower option "Add Python 3.7 to PATH". Click "Customize installation".

 Next!
 Default installation folder is C:\Python3. Click Install!

And after a short wait, Python 3.7.0. has been installed succesfully.

4.  And we can verify the succesfull installation by searching for "cmd" and opening the "Command Prompt" by hitting Enter.


Now we can write a commad to the command prompt: python --version 
and python gracefully answers with version 3.7.0. 


If the command produces an error, it means that the Python installation path has not been added to the Windows PATH environment variable and that's why the command prompt can't find it.

But we can fix this by simply adding it to the PATH!


5. Setting Windows 10 Environment variables

The most important environment variable is PATH, which the command prompt uses to find paths to installed programs. Python has its own internal path variable named PYTHONPATH, that is used as the default directory for findgin Python libraries and modules.

Open the Environment variables by writing "environment variables" to search and press Enter.


 Click on Environment Variables.

 Choose the PATH variable and doubleclick it.

Click NEW button and add two new lines:
C:\Python3
C:\Python3\Scripts

Click OK and confirm changes. Now, when you open the command prompt (Step 4) and try the command again, it should print the correct version number.

(Extra tip for maintaining both Python 2.7 and Python 3.7 installations)

6. If you have both Python 2.7 and Python 3.7 installed and you want to use both of them through the command prompt, rename one the python.exe files. In the example picture below, I renamed my Python 3 installation's .exe file to "python3.exe". Now I can write "python3 --version", when I want to use Python 3 and write "python --version", when I want to use the old Python 2.7.




  Last updated 10.10.2018

Python 3 asennusohje

1. Lataa asennustiedosto 
Mene osoitteeseen: https://www.python.org/downloads/ ja lataa Pythonin uusin asennustiedosto 3.7.1. omalle käyttöjärjestelmällesi. Tämä ohje on tehty käyttäen Windows 10 -käyttöjärjestelmää.

2. Käynnistä asennus
Käynnistä tiedoston python-3.7.1.exe asennus.


Tässä vaiheessa voit lisätä Pythonin Windowsin ympäristömuuttujiin valitsemalla rastin alempaan vaihtoehtoon "Add Python 3.7. to PATH". Ympäristömuuttujien asettaminen käydään vielä läpi tämän ohjeen lopussa. Valitse "Customize installation".

 Next!
 Asennuskansioksi sopii C:\Python3. Meillä voi olla asennettuna samaan aikaan Python 2.7 kansioon C:\Python27 ja kumpikin elää sovussa keskenään. Install!

Ja Python 3.7.1. on asennettu onnistuneesti!

3. Varmista asennuksen onnistuminen
 Ja tämän voimme todeta avaamalla komentorivin kirjoittamalla "cmd" Windowsin hakuun ja valitsemalla "Command Prompt" tai vain painamalla Enter.


# Nyt voimme kirjoittaa komentoriville komennon:
python --version 

ja Python vastaa onnistuneesti versionumerolla 3.7.1.
(kuvassa tehty vanhemmalla versiolla) 


Mikäli komento tuottaa virheen, se tarkoittaa, että Python -asennuksen polkua ei ole lisätty Windowsin PATH-muuttujaan, eikä komentorivi siksi löydä komentoa.

Mutta tämä voidaan korjata lisäämällä asennuspolku ympäristömuuttujaan!

4. Windowsin ympäristömuuttujien asettaminen

Tämä on tärkeä taito oppia, sillä ympäristömuuttujia pitää muokata ja lisätä jatkossakin. Tärkein tietää näistä on PATH, minkä kautta esimerkiksi komentokehote löytää asennuspolut. Pythonilla on oma sisäinen ympäristömuuttuja PYTHONPATH, joka on Python-kirjastojen oletushakupolku. 

Avaa ympäristömuuttujat kirjoittamalla hakuun "environment variables" ja paina Enter.


 Valitse valikosta Environment Variables.

 Valitse PATH muttuja ja tuplaklikkaa sitä (tai valitse se ja paina Edit).

# Lisää kaksi uutta riviä New-napista ja lisää siihen:
C:\Python3
C:\Python3\Scripts

Klikkaa Ok ja varmista muutokset. Nyt kun avaat komentorivin (Kohta 3) ja kokeilet komentoa uudestaan, versionumeron pitäisi tulostua oikein.

5. LISÄVINKKI: Python 2.7 ja Python 3.7 rinnakkain
Mikäli sinulla on asennettuna koneellasi sekä Python 2.7. ja Python 3.7. ja haluat käyttää molempia komentoriviltä, kannattaa toinen python.exe-tiedostoista nimetä uudelleen.

Alla olevassa esimerkissä nimesin Python 3 asennuksen .exe tiedoston "python3.exe". Nyt voin kirjoittaa komentoriville "python3 --version", kun haluan käyttää Python 3.7.0 ja pelkkä "python --version", kun haluan käyttää vanhaa Python 2.7.



Päivitetty 10.10.2018

Lista testiautomaatiotyökaluista

lauantai 26. toukokuuta 2018

Testiautomaatioammattilainen tuntee yleisimmät käytössä olevat testiautomaatiotyökalut sekä ymmärtää teknologiaa ja yleisimpiä käytettävissä olevia tekniikoita, scriptejä, framewörkkejä, kieliä, käyttöjärjestelmiä ja muita yleisiä ohjelmistokehityksen työkaluja. Testiautomaatioammattilainen käyttää keräämäänsä työkalupakkia ja hallitsee valitsemansa työkalut monipuolisesti ja tehokkaasti. Testiautomaatioammattilainen osaa valita oikeat työkalut oikeaan työhön. Osa testiautomaatiokehittäjän työnkuvaa on myös seurata alan kehitystä ja uusimpia työkaluja, esim. vierailemalla eri testausalan konferensseissa.

Olen kerännyt tähän alle listan yleisiä testiautomaatiotyökalujaa eri kategorioissa:

Funktionaalinen testaus -työkalut:
Visuaalinen testaus -työkalut:
Defect management -työkalut:
Continuous Integration -työkalut:
DevOps-työkalut:
Viestintä-työkalut:
Yritän päivittää listaa parhaani mukaan. Tämä on versio 0.1.0. Jos keksit jonkun työkalun, joka mielestäsi kuuluisi listalle, laita kommentti tähän postaukseen.

Lista päivitetty 26.05.2018