2.1. Lists
Goal
- Create a new test suite named
02-Classroom
, which has a suite named01-Lists
. - Store multiple names in a suite variable. Examples:
Jane Doe
andJohn Doe
. - Create a new keyword named
Print Multiple Names
which takes a list of names and logs them to console.
Solution
Hints
You can iterate through elements of a list by using FOR
loop.
Click here to learn more about FOR
loops.
The old syntax of FOR
loop is deprecated since Robot Framework 3.2 and it will be removed in 4.0.
Solution: tests/02-classroom/resources/lists.resource
1 2 3 4 5 6 7 |
|
Solution: tests/02-classroom/01-lists.robot
1 2 3 4 5 6 7 8 9 10 11 |
|
Results
Inside the tests
folder, execute the following command to execute 02-Classroom
suite.
1 |
|
The output should be something like this:
==============================================================================
02-Classroom
==============================================================================
02-Classroom.01-Lists
==============================================================================
Greetings Everyone :: This test case verifies the functionality of...
Jane Doe
John Doe
Greetings Everyone :: This test case verifies the functionality of... | PASS |
You can check the generated log.html
file to see how your test cases worked.
Last update: June 22, 2020