Suite files and sections
Chapter lab: Your first suite
This chapter works in a prepared project. Download it before the first task; it unpacks into its own folder.
Or fetch and unpack it from a terminal in VS Code:
curl -fsSLO https://manykarim.github.io/robotframework-essentials-web/labs/ch02-first-suite.zip && unzip -q ch02-first-suite.zip && rm ch02-first-suite.zipInvoke-WebRequest https://manykarim.github.io/robotframework-essentials-web/labs/ch02-first-suite.zip -OutFile ch02-first-suite.zip; Expand-Archive ch02-first-suite.zip -DestinationPath .; Remove-Item ch02-first-suite.zipOpen the folder in VS Code with code rfe-ch02-first-suite (or File → Open Folder…) and accept the recommended RobotCode and Python extensions. Then set it up:
uv syncpython3 -m venv .venvsource .venv/bin/activatepip install -r requirements.txtpython -m venv .venv.venv\Scripts\Activate.ps1pip install -r requirements.txtKeep the environment active in every terminal where you run lesson commands.
poetry install --no-rootPython 3.13 or newer is required; uv installs it when it is missing.
Open in browserNo setup? Try the lab right here: its files, an editor and a terminal, running in your browser.
What's inside
Directoryrfe-ch02-first-suite/
Directory.vscode/
- extensions.json
- .gitignore
- .python-version
- LAB.md
- pyproject.toml
- README.md
- requirements.txt
- uv.lock
A suite file is organised into sections, each introduced by a header
written with three asterisks: *** Settings ***, *** Variables ***,
*** Test Cases ***, *** Keywords ***, and *** Comments ***. You use only
the ones you need.
Your first suite needs two: Settings for a line of documentation, and Test Cases for the test itself. A test case is a name on its own line, followed by indented keyword calls.
Task 1 — Write a suite with a Settings and a Test Cases section
Section titled “Task 1 — Write a suite with a Settings and a Test Cases section”Create checks/first_suite.robot with a documented suite and one test that
logs a message:
*** Settings ***Documentation My first Robot Framework suite.
*** Test Cases ***Framework Is Running Log Robot Framework is running.Each keyword and its argument are separated by two or more spaces — that is
how Robot Framework tells the Log keyword apart from its message.
Done when
checks/first_suite.robot defines the test Framework Is Running
and calls Log.
Task 2 — Run the suite and see it pass
Section titled “Task 2 — Run the suite and see it pass”Run the suite:
uv run robot checksrobot checkspoetry run robot checksThe console prints Framework Is Running | PASS and a green summary.
Done when
the test Framework Is Running passes.
Check your understanding
Quick recall. Your first answer stays in this browser; the quiz never blocks your progress.
Section headers in a suite file are written as…
Sections use three asterisks, a space, the name, a space, three asterisks — e.g.
*** Test Cases ***.Show the answer
Answer:
*** Settings ***— Sections use three asterisks, a space, the name, a space, three asterisks — e.g.*** Test Cases ***.Which section holds the tests themselves?
Test cases live under
*** Test Cases ***; Settings configures the suite, Variables holds values.Show the answer
Answer:
*** Test Cases ***— Test cases live under*** Test Cases ***; Settings configures the suite, Variables holds values.
Key terms
- * Settings *concept
- Suite section for imports (Library/Resource), documentation, and setup/teardown.
- * Test Cases *concept
- Suite section holding the test cases; each test is a sequence of keyword calls.