Learning Robot Framework with Python on a Linux machine
Home / Programming / Test and Automation / Learning Robot Framework with Python on a Linux machine
Day 0
official YouTube RF beginners tutorial
Note: This is a work in progress. I am taking notes while exploring Robot Framework and plan to revisit and refine them once I'm more comfortable with the framework. (August 2025)
1. Create a new directory to keep all files and notes related to learning the framework in one place. For example,
mkdir robotf
cd robotf
2. Create a virtual environment for Python and activate it.
python3 -m venv robotfsource robotf/bin/activatepip3 install robotframeworkrobot --version3. Load the virtual environment in VS Code (or your preferred IDE/command line) and set up a basic folder structure. The project name is testbase, and it currently includes only the minimum files needed.
4. Add those basic lines to file suiteA.robot.
*** Settings ***
Resource resources/common.resource
Library resources/custom_library.py
Variables resources/variables.pyFrom the terminal,from the root directory testbase run this:
robot --pythonpath . tests/suiteA.robot[ ERROR ] Suite 'suiteA' contains no tests or tasks.Keyword-Driven Specification
5. This website will be used for the demo.
Add those basic lines to file suiteA.robot. They represent the procedures followed by the test in the specific order.
*** Test Cases ***
Verify Browse Sweets Link
Open Page https://sweetshop.netlify.app/
Click Button Browse Sweets
Verify Title Sweet Shop
Verify Url https://sweetshop.netlify.app/sweets
** Keywords ***
Open Page
New Browser headless=${FALSE}
New Page https://sweetshop.netlify.app/
Library Browserpip3 install robotframework-browserRF-Browser dependencies not found in installation path!
Run `rfbrowser init` to install.rfbrowser initInstalling node dependencies...
Couldn't execute npm. Please ensure you have node.js and npm installed and in PATH.See https://nodejs.org/ for documentation
*** Settings ***
Resource resources/common.resource
Library resources/custom_library.py
Library Browser
Variables resources/variables.py
*** Test Cases ***
Verify Browse Sweets Link
Open Page #open the page
Click Button Browse Sweets #find and click on button Browse Sweets
Title Should Be Sweet Shop # Checks the title of the page
Url Should Be https://sweetshop.netlify.app/sweets # Checks the URL of the page
*** Keywords ***
Open Page
New Browser headless=${FALSE}
New Page https://sweetshop.netlify.app/
Click Button
[Arguments] ${expected}
Click text=${expected}
Title Should Be
[Arguments] ${title}
${page_title} = Get Title
Should be Equal ${title} ${page_title}
Url Should Be
[Arguments] ${url}
${page_url} = Get URL
Should be Equal ${url} ${page_url}
Ta-daa!

