1.5. Create a common resource file
Goal
- Move the keyword named
Print Your Name
to a common resource file namedgreetings.resource
. - Import this resource file in
01-Greetings
suite to makeGreetings
test case pass. - Rename
Greetings
test case toOriginal Greetings
. - Store another name in the
greetings.resource
and log it in a new test case namedGreetings Again
usingPrint Your Name
keyword.
Solution
Hints
You can import resource files using the Resource
setting in the *** Settings ***
table.
Click here to learn more about importing resource files.
You can use built-in variables related to operating system like ${CURDIR}
, ${EXECDIR}
and ${/}
when you define the path for a resource file.
Click here to learn more about operating system related variables.
Solution: tests/01-greetings/resources/greetings.resource
1 2 3 4 5 6 7 |
|
Solution: tests/01-greetings/01-greetings.robot
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
Results
Inside the tests
folder, execute the following command to execute both test cases.
1 |
|
You can check the generated log.html
file to see how your test cases worked.
Last update: June 22, 2020