Store another name in the __init__.robot file and log it in a new test case named Greetings From Global using Print Your Name keyword.
Solution
Solution: tests/__init__.robot
1
2
3
4
5
6
7
8
9
10
11
12
13
14
*** Settings ***Suite SetupGlobal Suite SetupSuite TeardownGlobal Suite Teardown*** Keywords ***Global Suite SetupLogOur Robot awesomeness begins!Set Global Variable ${NAME_FROM_INIT}Global Suite TeardownLogThe end of the awesomeness!*** Variables ***${NAME_FROM_INIT} Global Name
*** Test Cases ***Original Greetings [Tags] ubuntu [Documentation] This test case checks that the Print Your Name keyword works as expected.Print Your NamePrint Your Name ${YOUR_NAME}Greetings Again [Tags] centos [Documentation] This test case proves that we can import variables from resource files.Print Your Name ${ANOTHER_NAME_IN_RESOURCE}Greetings From Init [Tags] centosubuntu [Documentation] This test case proves that we can create global variables using initialization files.Print Your Name ${NAME_FROM_INIT}*** Settings ***Resource ${CURDIR}${/}resources${/}greetings.resource*** Variables ***${YOUR_NAME} Your Name
Results
Inside the tests folder, execute the following command.
1
robot .
You can check the generated log.html file to see how your test cases worked.