Robot Framework supports several types of variables to handle different kinds of data and scenarios in your tests. Here's a breakdown of the main variable types:
1. Scalar Variables (${...}):
${USERNAME} myuser
${AGE} 30
${IS_ADMIN} True
2. List Variables (@{...}):
@{COLORS} red green blue
@{USER_ROLES} admin editor viewer
3. Dictionary Variables (&{...}):
&{USER_DATA} name=John age=30 city=New York
&{PRODUCT} id=123 name=Laptop price=999
4. Environment Variables (%env{...}):
%{PATH}
%{USERNAME}
5. Built-in Variables:
${CURDIR}: The absolute path to the directory where the test data file is located.${TEMPDIR}: The absolute path to the system temporary directory.${EXECDIR}: The absolute path to the directory where test execution was started from.6. Extended Variable Syntax:
Key Considerations:
${...}, @{...}, &{...}, and %env{...} are used to identify the type of the variable.