What is Robot Framework?
Robot Framework is an open-source automation tool that lets you write tests in plain English-looking sentences, not in dense code. If Selenium is the engine, Robot Framework is the steering wheel, easier to grip if you have never programmed before.
A test, before any theory
Read this like English:
*** Settings ***
Library SeleniumLibrary
*** Test Cases ***
User can log in
Open Browser https://demo.example.com Chrome
Input Text id=email [email protected]
Input Text id=password secret123
Click Button id=login
Page Should Contain Welcome back
Close Browser
Three things to notice:
- Anyone, including a product manager who does not write code, can follow what is being tested. That is the whole point.
- Each indented line is a keyword:
Open Browser,Input Text,Click Button. You glue keywords together; the framework does the heavy lifting. - No
if, nofor, no curly braces. The structure is a tidy table of words.
Why teams pick it
- Reads like a spec. A non-coder on the team can review the test. That matters more than people admit.
- Batteries included. Built-in keywords cover most of what you need (
Should Be Equal,Wait Until Page Contains,Log). - Extensible. When the built-in keywords are not enough, you write your own in Python and call them with the same plain-English syntax.
- Strong library ecosystem. SeleniumLibrary for UI, RequestsLibrary for APIs, DatabaseLibrary for SQL, plus mobile and desktop libraries.
Keyword-driven, in one sentence
You write Log In As User riya. Somewhere (a library, or a keyword you wrote earlier) someone has already told the framework what those words mean. You compose at the high level; the low-level HTTP, browser, and DB calls live elsewhere.
Quick check
Q1. What is the main reason to choose Robot Framework over writing tests directly in Python with pytest + Selenium?
A. It runs faster. B. The tests read like a spec, so non-coders on the team can review them. C. It supports more browsers. D. It has better assertion messages.
Hint: Two of those are not true. Speed and browser support are roughly equal because Robot Framework uses Selenium underneath. What is the one thing Robot Framework gives you that raw pytest does not?
Answer: B. The keyword syntax is the entire reason Robot Framework exists. If everyone on your team writes code, pytest is usually a better choice (more flexible, faster to debug). Robot Framework wins when product owners, business analysts, or junior testers need to read or even write tests.
Q2. Look at the test above. What do you expect the keyword Page Should Contain Welcome back to do?
Hint: Read the words.
Answer: It checks that the text "Welcome back" appears anywhere on the current page. If it does, the test passes; if not, the test fails with a clear message saying the expected text was missing. That readability is the whole pitch.
Try this
Take a manual test case you already have (or one from a previous job). Write the first three steps using made-up keyword names that read like English. You are not running it, just feeling the syntax. Next lesson, you install Robot Framework and run a real one.