Loop Through a Test Data File
Attach a test data file to a test case or keyword, so it runs once for each row of data.
Sometimes you want specific values, not generated ones, such as quantities with a known total. Put them in a test data file (.csv), one row per test run, and attach the file to a test case or a keyword. Sahi Pro then runs it once for each row.
On this page, you run the Buy Books test case with three sets of quantities.
Parameterize Add Books
Section titled “Parameterize Add Books”- In the No-Code Test Editor, select the Add Books keyword, and click Parameterize.
- Select the three steps that enter the quantities, and the step that checks the total.
- Name the parameters
$javaQty,$rubyQty,$pythonQtyand$total, and click Apply.
Attach a Test Data File
Section titled “Attach a Test Data File”-
Select the Buy Books test case, the one that should loop through the data, and click Data Drive.
-
In the Data Drive dialog, choose New File.
-
Name the test data file
books_data, and name its groupquantities. A test data file keeps its rows in groups. -
Add a column for each parameter, and one row for each test run. Name each column after its parameter, without the
$:javaQty rubyQty pythonQty total 2 3 1 1550 1 0 0 300 0 4 2 1500 -
Click Confirm.
To loop through only one keyword instead of the whole test case, attach the file to that keyword.
Run the Test Case
Section titled “Run the Test Case”Run the Buy Books test case. Sahi Pro runs it three times, once for each row, and the report shows a result for each row.

