Test case logic

Variable definition

Section variable

Set a section variable name to use its value in more than one position within a test case section:

${<var name>} Set Variable <var value>

Section list

Set a section list name to use its values in more than one position within a test case section and eventually in a loop:

@{list name} Create List <value 1> <value 2> <value n>

Global variable

Set a global variable name to use its value in more than one position within a test case:

Set Global Variable ${<var name>} <var value>

Global list

Set a global list name to use its value in more than one position within a test case and eventually in a loop:

Set Global Variable @{list name} <value 1> <value 2> <value n>

Catenate

Join a number of text strings (e.g. from a list) in a name for setting a variable name with a fixed prefix and different suffixes:

${<var name>} Catenate SEPARATOR= <part 1> <part n>

Conditional and loop

IF syntax

Set a conditional flow executing a keyword with its arguments just in case the given condition is satisfied:

Run Keyword If '${<var name>}' == '<var value>' <keyword name> <keyword arg>

FOR syntax

Set a loop (e.g. looping a list of numbers) for executing the indented section that follows until the given exit condition is satisfied:

:FOR ${<index>} IN @{list name}
  ${<var name>} <key name> ${<index>}
  Exit For Loop If '${<var name>}' == '<var value>'  

Fail section trigger

Trigger the fail_section of a test case (typically in the teardown section) just in case it fails within its main body:

${fail_test} Set Variable ${PREV TEST STATUS}
Run Keyword If '${fail_test}' == 'FAIL' fail_section