Skip to main content

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โ€‹

LibraryUse
SeleniumLibraryweb UI
RequestsLibraryAPI testing
Collectionslist/dict helpers
OperatingSystemfiles, 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

Tagsโ€‹

*** Test Cases ***
Smoke Test
[Tags] smoke critical
robot --include smoke tests/

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.
See: When to Choose Robot Framework Over a Code-First Framework