Skip to content

Commit e9fd4b8

Browse files
committed
small addition due to exam ;-) hint hint
1 parent af6f0e4 commit e9fd4b8

2 files changed

+17
-6
lines changed

Chapter_3_Keyword_Design_Variables_Resources.md

+15-5
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ Variables in Robot Framework are defined by three attributes:
109109
- **Variable Name**: The string that addresses the variable. i.e. just the `variable_name` or more advanced access ways.
110110

111111
Variable names are case-insensitive and as keywords, containing single spaces and underscores are ignored when matching variable names.
112+
Robot Framework supports Unicode and allows the use of special characters and even Emojis in variable names.
112113

113114
In case these prefixes followed by a curly brace opening (`${`) should be used as characters in a normal string and not as a variable,
114115
they must be escaped by a backslash like `\${` to be treated as text rather than a variable start.
@@ -498,10 +499,17 @@ As a reference for how defined keywords are documented, see [2.5 Keyword Interfa
498499
499500
The names of User Keywords should be descriptive and clear, reflecting the purpose of the keyword.
500501
Well-named keywords make tests more readable and easier to understand.
502+
Robot Framework supports Unicode and allows the use of special characters and even Emojis in keyword names.
501503

502504
Keyword names are case-insensitive and can include spaces.
503505
Also spaces and underscores will be ignored when matching keyword names.
504506
So the keywords `Login To System`, and `log_into_system` are considered identical.
507+
508+
To identify keywords that shall be executed, Robot Framework uses a matching algorithm that is case-insensitive and ignores spaces and underscores.
509+
If then a full match is found, that keyword is used.
510+
If no full match is found, the prefixes `Given`, `When`, `Then`, `And`, and `But` (case-insensitive), which are used in Behavior-Driven Specification style, are removed from the called keyword name to find a match.
511+
If still no match is found, Robot Framework tries to match the name with keywords that have embedded arguments.
512+
505513
By default, if not explicitly defined by the library developers, all Library Keywords are named in **Title Case** with capital letters at the beginning of each word, and spaces between words.
506514

507515
Project may choose a different naming convention for User Keywords, but it is recommended to be consistent across the project for User Keyword names.
@@ -618,10 +626,12 @@ In that case, the argument `${file_path}` is assigned the value `server.log`, an
618626
Optional arguments are defined by assigning default values to them in the `[Arguments]` setting.
619627
All optional arguments must be defined after all mandatory arguments.
620628

621-
Default values are assigned by the equal sign (`=`)
622-
followed by the default value without any spaces like `${ignore_case}=True`.
629+
Default values are assigned using an equal sign (`=`),
630+
followed by the default value without any spaces, such as `${ignore_case}=True`,
631+
which would set the string `True` as default.
623632

624-
The assigned default values may also contain or be earlier defined variables, i.e., in the `*** Variables ***` section.
633+
The assigned default values can also include previously defined variables,
634+
such as `${ignore_case}=${True}`, where `${True}` represents the boolean value `True`.
625635

626636
Example:
627637
```robotframework
@@ -634,8 +644,8 @@ Verify File Contains
634644
...
635645
... By default, the verification is case-insensitive
636646
... but can be changed with the optional argument ``ignore_case``.
637-
[Arguments] ${file_path} ${expected_content} ${ignore_case}=True # ignore_case has the string 'True' as default value
638-
${server_log} = Get File ${file_path}
647+
[Arguments] ${file_path} ${expected_content} ${encoding}=utf-8 ${ignore_case}=${True}
648+
${server_log} = Get File ${file_path} ${encoding}
639649
Should Contain ${server_log} ${expected_content} ignore_case=${ignore_case}
640650
```
641651

Chapter_5_Exploring_Advanced_Constructs.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ Variables in Robot Framework have different scopes, determining where they can b
9191
- **Definition**: Variables accessible everywhere during the test execution.
9292
- **Creation**:
9393
- Set from the command line using `--variable` or `--variablefile` options. (static)
94-
- Created during execution using the `VAR` syntax with the `scope=GLOBAL` argument at any point. (dynamic)
94+
- Created during execution using the `VAR` syntax with the `scope=GLOBAL` argument. (dynamic)
9595
- **Usage**: Ideal for configuration parameters that need to be consistent across the entire test run.
9696

9797
Because global variables set via the command line have the highest priority, they can override other variables defined in the suite or resource files.
@@ -254,6 +254,7 @@ Variables containing a list are generally accessed with the normal dollar-syntax
254254
You can also access single values within a list using `${var}[0]` or `${var}[-1]`, and Robot Framework supports slicing, similar to Python, with `${var}[1:3]` or `${var}[1:]`.
255255

256256
However, in some cases, it is necessary to unpack the values of a list variable to use them as a sequence of multiple individual values. This is done using the at-syntax `@{var}` when accessing the variable.
257+
Unpacking works for iterable values, but is NOT possible with strings!
257258

258259
Example:
259260

0 commit comments

Comments
 (0)