When you need to check the same behaviour against many inputs, copying a test and changing one value is a waste. Data-driven testing runs one test across many sets of data, so the logic lives in one place and the examples are just rows.
The test template
The simplest way in is a test template. You point a test at a keyword, and each row becomes a call to that keyword with different arguments:
*** Settings ***
Test Template Login Should Fail
*** Test Cases *** USERNAME PASSWORD
Empty Password standard_user ${EMPTY}
Wrong Password standard_user nope
Unknown User ghost secret
Each row is a named test that runs the same Login Should Fail keyword with its own data. One place to change the logic, and a clear, readable list of the cases you cover.
Data from outside the file
When the data grows, or lives in a spreadsheet someone else maintains, you can drive tests from an external source such as a CSV file using the DataDriver library. The tests stay the same, and the data becomes something a non-technical colleague can edit.
Where it fits
Data-driven testing builds directly on variables, and it pairs well with tags so you can run a data-heavy set on its own. Knowing when a template is the right tool, and how to keep the data readable, is part of designing a suite that scales. Our Robot Framework Certified Professional course covers data-driven testing alongside keywords and libraries, and prepares you for the RFCP exam.
Frequently asked questions
What is a test template? A keyword that every row of a test runs with different arguments. It turns a group of similar tests into one template plus a table of data.
Can I load data from a file? Yes. Libraries such as DataDriver let you drive tests from external sources like CSV, so the data can live outside the test and be edited by others.
When should I use data-driven testing? When you are checking the same behaviour across many inputs, such as validation rules. If each case needs different steps, separate tests are clearer.
Next: control structures in Robot Framework, or revisit variables.