Shikha Singh
Ayraa
Published in
2 min readMay 23, 2024

--

How to setup UI Automation on Linux server :Robot Framework

I will be discussing here — how to setup your UI automation framework written in robot framework on Linux distribution (Amazon linux 2 in my case).

  1. Install Python 3 ( robot framework test-cases are written in python and require python to be run)
  2. Install Chrome browser and ChromeDriver

(i) Google-chrome

google-chrome - version

(ii) Chrome Driver-

wget https://storage.googleapis.com/chrome-for-testing-public/123.0.6312.122/linux64/chromedriver-linux64.zip

(Replace driver version to one compatible with your chrome-browser)

unzip chromedriver_linux64.zip
sudo mv chromedriver_linux64/chromedriver /usr/local/bin/
sudo chmod +x /usr/local/bin/chromedriver

4. Verify installations

google-chrome --version
chromedriver --version

3. Robot Framework and SeleniumLibrary installation: Make sure that Robot Framework and SeleniumLibrary are installed in the environment. You can include these installations in the pipeline to ensure the correct versions are used.

4. Set Environment Path: Ensure that the PATH environment variable is correctly set for chromedriver, robot installations in .bashrc file

+ which chromedriver
/usr/local/bin/chromedriver
echo 'export PATH=$PATH:/usr/local/bin' >> ~/.bashrc
source ~/.bashrc

5. Create minimalistic Robot Framework test case

test_robot.py

*** Settings ***
Library SeleniumLibrary
Suite Teardown Close All Browsers

*** Test Cases ***
Open Google
${chrome_options}= Evaluate sys.modules['selenium.webdriver'].ChromeOptions() sys, selenium.webdriver
Call Method ${chrome_options} add_argument --headless
Call Method ${chrome_options} add_argument --no-sandbox
Call Method ${chrome_options} add_argument --disable-dev-shm-usage
Call Method ${chrome_options} add_argument --disable-gpu
Call Method ${chrome_options} add_argument --disable-software-rasterizer
Create Webdriver Chrome options=${chrome_options}
Go To https://www.google.com
Maximize Browser Window
[Teardown] Close Browser

5. Run robot test-cases

robot test_robot.py

--

--