Robot Framework cheatsheet
A one-page reference for Robot Framework. For reporting and framework comparisons, see the complete guide.
๐ Full guide: Robot Framework โ BeginnerLearn this in 5 minutes5 min
- Begin with the Suite file structure card
- Then the Built-in libraries and Custom keywords cards
- Treat the other 4 cards as lookups โ scan by card title when you need one
- Open the full guide when a card isn't enough
Suite file structureโ
*** Settings ***
Library SeleniumLibrary
*** Variables ***
${URL} https://example.com
*** Test Cases ***
Valid Login
Open Browser ${URL} chrome
Input Text id:username abhishek
Click Button Sign in
Page Should Contain Welcome
Built-in librariesโ
| Library | Use |
|---|---|
| SeleniumLibrary | web UI |
| RequestsLibrary | API testing |
| Collections | list/dict helpers |
| OperatingSystem | files, env vars |
Custom keywordsโ
*** Keywords ***
Login As
[Arguments] ${user} ${pass}
Input Text id:username ${user}
Input Text id:password ${pass}
Click Button Sign in
Reusable, human-readable โ the keyword-driven equivalent of a Page Object method.
Data-driven testingโ
*** Test Cases ***
Login Attempts
[Template] Try Login
admin right success
admin wrong error
Reportingโ
robot --outputdir results tests/
Generates log.html (step-by-step trace) and report.html (pass/fail summary) automatically โ no extra plugin needed.
When to choose Robot Frameworkโ
- Team includes non-programmers who need to read/write test cases.
- Keyword-driven style matters more than raw language flexibility.
- Not ideal when tests need heavy custom logic โ code-first frameworks (Selenium/Playwright + Java/Python) scale better there.