Introduction
A robot framework is an open-source, generic, keyword-driven test automation framework that uses a tabular test data syntax. It was originally developed by Pekka Klärck in 2005 and is currently maintained by the Robot Framework Foundation.
In this post, We will show you how to install and configure robot-framework on ubuntu 22.04 LTS.
Step 1: Run System Updates
We need to update the system uppdate and upgrade the packages by using given command.
To update the repository.
sudo apt-get update
To upgrade the packages.
sudo apt-get upgrade -y
Step 2: Installing Google Chrome
We need to install the google chrome browser by using given command.
To install to dependencies.
sudo apt-get install unzip xvfb libxi6 libgconf-2-4 -y
To download the google chrome latest version.
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
To install the google chrome.
sudo dpkg -i google-chrome-stable_current_amd64.deb
Step 3: Installing Chromedriver
We need to install the same version of google driver from the google chrome driver download link.
wget https://chromedriver.storage.googleapis.com/112.0.5615.49/chromedriver_linux64.zip
To unzip the google chrome driver zip file.
unzip chromedriver_linux64.zip
To move the google chrome driver to /usr/bin
sudo mv chromedriver /usr/bin/chromedriver
To update the permission.
sudo chown root:root /usr/bin/chromedriver
To make excutable google chome driver.
sudo chmod +x /usr/bin/chromedriver
Step 4: Installing Python3
We need to use the follwing command to install python3.
sudo apt-get install python3 python3-pip -y
To check python version.
python3 --version
Step 5: Installing Robot-Framework
To install the robot-framework we need to use the given command.
pip3 install robotframework robotframework-seleniumlibrary
To check robot version.
python3 -m robot --version
Step 6: Creating Robot Script
We need to test the robot framework to test it should working fine with chrome browser.
To create sample robot script.
nano openGoogle.robot
Paste the following configuration.
Note: This is stable for non-gui linux based machine or remote machine with headless config.
*** Settings ***
Library SeleniumLibrary
Documentation
... My First Test
... This test will Verify Google
*** Keywords ***
Navigate To Google
Open Browser https://www.google.com headlesschrome
Verify Page Contains Google
${Get_title}= Get Title
Should Be Equal As Strings ${Get_title} Google
Close Browser
*** Test Cases ***
Open Google & Verify Google
Navigate To Google
Verify Page Contains Google
Use the given robot code for GUI.
*** Settings ***
Library SeleniumLibrary
Documentation
... My First Test
... This test will Verify Google
*** Keywords ***
Navigate To Google
Open Browser https://www.google.com browser=chrome
Verify Page Contains Google
${Get_title}= Get Title
Should Be Equal As Strings ${Get_title} Google
Close Browser
*** Test Cases ***
Open Google & Verify Google
Navigate To Google
Verify Page Contains Google
To execute the robot script.
python3 -m robot openGoogle.robot
Conclusion
We have successfully install and configure robot framework on ubuntu 22.04 LTS. If you are still facing problems, feel free to leave a commit.
Awesome.
Excellent.
Clean installation steps.
This is very clean installation setup, Do keep writing more articles, Thanks 🙂
Thanks for the complement, Our team will do create more articles.
Simple and clean installation setup.
Thanks.
Awesome.
Superb.
Clean installation.
Эта статья – источник ценной информации! Я оцениваю глубину исследования и разнообразие рассматриваемых аспектов. Она действительно расширила мои знания и помогла мне лучше понять тему. Большое спасибо автору за такую качественную работу!
Thanks for the appreciation 🙂
Спасибо