Skip to content

1.2. Put your name in a variable

Goal

  • Store your name in a variable using the *** Variables *** table.
  • Modify the Greetings test case to use the newly created variable instead of the hard coded name!

Solution

Hints

You can define suite variables in the *** Variables *** test data section.

Click here to learn more about variables.

Solution: tests/01-greetings/01-greetings.robot
1
2
3
4
5
6
*** Test Cases ***
Greetings
    Log    ${YOUR_NAME}

*** 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 case worked.


Last update: June 22, 2020