Skip to content

Suite files and sections

Chapter lab: Your first suitech02-first-suite.zip · 3 KB

This chapter works in a prepared project. Download it before the first task; it unpacks into its own folder.

Download ch02-first-suite.zip

Or fetch and unpack it from a terminal in VS Code:

Terminal window
curl -fsSLO https://manykarim.github.io/robotframework-essentials-web/labs/ch02-first-suite.zip && unzip -q ch02-first-suite.zip && rm ch02-first-suite.zip

Open 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:

Terminal window
uv sync
Terminal window
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

Keep the environment active in every terminal where you run lesson commands.

Terminal window
poetry install --no-root

Python 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”
Edit

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.

Run

Run the suite:

Terminal window
uv run robot checks
Terminal window
robot checks
Terminal window
poetry run robot checks

The 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.

  1. Section headers in a suite file are written as…

    Show the answer

    Answer: *** Settings *** — Sections use three asterisks, a space, the name, a space, three asterisks — e.g. *** Test Cases ***.

  2. Which section holds the tests themselves?

    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.

All terms in the glossary →