Robot Framework cheatsheet
A one-page reference for Robot Framework. For reporting and framework comparisons, see the complete guide.
๐ Full guide: Robot Framework โ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.