Skip to content
Novus Examples
robot682 B

Robot Framework — Data-Driven Test Template

The template form, in which the *** Test Cases *** header itself names the argument columns and each row becomes one test. Five tests share a single keyword body, and a parser that reads the header row as a test name reports six.

Preview — first 19 linesrobot
*** Settings ***
Documentation     Data-driven discount rules using a test template.
Library           CartLibrary
Test Template     Discount Should Apply

*** Test Cases ***    SUBTOTAL    PERCENT    PAYABLE
Ten percent off ten pounds        10.00    10    9.00
Twenty percent off twenty-five    25.00    20    20.00
Five percent off ninety-nine      99.99     5    94.99
Zero percent changes nothing      10.00     0    10.00
One hundred percent is free       10.00   100    0.00

*** Keywords ***
Discount Should Apply
    [Arguments]    ${subtotal}    ${percent}    ${payable}
    Set Subtotal    ${subtotal}
    Apply Discount    ${percent}
    Payable Should Be    ${payable}

Specifications

Seed
61200
Encoding
UTF-8
Line Endings
LF
Syntax
space-separated plain text
Test Cases
5
Keywords
1
Uses Test Template
true
Template Columns
3
Argument Separator
four spaces

Testing contract

Expected to pass
Scenario
Expand a templated Robot suite into individual test cases.
Expected result
5 tests are produced, each binding SUBTOTAL, PERCENT and PAYABLE from its row; the header row is not itself a test.

What is a .robot file?

A .robot file is a Robot Framework test suite written in the framework's plain-text tabular syntax. Sections introduced by headers such as *** Settings ***, *** Variables ***, *** Test Cases ***, and *** Keywords *** hold library imports, variable definitions, keyword-driven test cases, and user-defined keywords, with arguments separated by two or more spaces. Tags, documentation, setup, and teardown are declared inline as settings.

How to use this file

Use an example .robot file to test Robot Framework parsers, linters, and editor tooling — checking section handling, the two-space argument separator, variable substitution, and keyword resolution against a suite whose structure is documented.

How to use this file for testing

“Robot Framework — Data-Driven Test Template” is a deterministic Novus Examples fixture for Code parsing, Editor testing, Conversion testing. Short, known-correct source files in many languages with classes, functions, generics, enums, and error handling — for testing parsers, linters, formatters, language detection, and diff viewers.

Documented properties for this file: seed 61200 · UTF-8 · LF. Compare results against paired or grouped companions on this page when present (clean↔damaged, searchable↔scanned, or format twins) so scores stay reproducible across runs.

Download the file once, keep the path stable in CI or local scripts, and treat the spec table as the contract: dimensions, seeds, field lists, and roles are intentional. Corrupt or invalid samples are labelled as such — expect parsers to fail loudly rather than silently accept them.

Test and coverage reports document their totals (suites, cases, passes, failures, skips, covered lines) in the spec table. Point your CI dashboard, coverage gate, or report converter at the file and assert those counts survive; format twins carry identical numbers so a conversion can be scored exactly.

Generated by generation/testing.py. Free for any use, no attribution required — license.