You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: Chapter_3_Keyword_Design_Variables_Resources.md
+15-5
Original file line number
Diff line number
Diff line change
@@ -109,6 +109,7 @@ Variables in Robot Framework are defined by three attributes:
109
109
-**Variable Name**: The string that addresses the variable. i.e. just the `variable_name` or more advanced access ways.
110
110
111
111
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.
112
113
113
114
In case these prefixes followed by a curly brace opening (`${`) should be used as characters in a normal string and not as a variable,
114
115
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
498
499
499
500
The names of User Keywords should be descriptive and clear, reflecting the purpose of the keyword.
500
501
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.
501
503
502
504
Keyword names are case-insensitive and can include spaces.
503
505
Also spaces and underscores will be ignored when matching keyword names.
504
506
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
+
505
513
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.
506
514
507
515
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
618
626
Optional arguments are defined by assigning default values to them in the `[Arguments]` setting.
619
627
All optional arguments must be defined after all mandatory arguments.
620
628
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.
623
632
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`.
625
635
626
636
Example:
627
637
```robotframework
@@ -634,8 +644,8 @@ Verify File Contains
634
644
...
635
645
... By default, the verification is case-insensitive
636
646
... 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
Copy file name to clipboardexpand all lines: Chapter_5_Exploring_Advanced_Constructs.md
+2-1
Original file line number
Diff line number
Diff line change
@@ -91,7 +91,7 @@ Variables in Robot Framework have different scopes, determining where they can b
91
91
-**Definition**: Variables accessible everywhere during the test execution.
92
92
-**Creation**:
93
93
- 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)
95
95
-**Usage**: Ideal for configuration parameters that need to be consistent across the entire test run.
96
96
97
97
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
254
254
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:]`.
255
255
256
256
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!
0 commit comments