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
Updated explanation for Keyword Matching (3.3.2) and examples for Free Named Arguments (2.5.1.2) (#80)
Important note: the image of the keyword documentation of the Set To
Dictionary keyword has to be changed. I did not know how to create the
'splitted' image with the waves in between, so please help me out on
that.
## Checklist
- [x] Label set: `impact:major` or `impact:minor`
- [x] PR title contains: Subject + Chapter scope + Topic
- [x] One bullet per issue/change (see “Issues”)
- [x] Each bullet includes a chapter (Ch. X or Ch. X.Y)
- [x] Uses imperative verbs (Fix / Remove / Rephrase / Clarify)
- [x] Descriptions are short (3–10 words)
## Major change checklist
- [x] Exam Committee reviewed and confirmed exam impact (link/note):
- [x] Training Providers informed (date + link): Training providers will be informed 21-04-2026
- [x] Effective date (countdown ends): YYYY-MM-DD
## Issues
- #74 Run Process examples in paragraph 2.5.1.2 replaced by Set To
Dictionary
- #77 Explanation on how keyword matching works changed to reflect new
functionality
Herewith issues and are solved.
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Gerwin <8427040+GerwinLaagland@users.noreply.github.com>
Copy file name to clipboardExpand all lines: website/docs/chapter-02/05_keyword_interface.md
+30-19Lines changed: 30 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,22 +62,23 @@ This keyword has 2 "Mandatory Arguments" and 6 "Optional Arguments".
62
62
All of them can be called positionally or by name.
63
63
64
64
65
-
### 2.5.1.2 Example Keyword `Run Process`
65
+
### 2.5.1.2 Example Keyword `Set To Dictionary`
66
66
67
-
[Documentation of `Run Process` from `Process` library](https://robotframework.org/robotframework/latest/libraries/Process.html#Run%20Process)
67
+
[Documentation of `Set To Dictionary` from `Collections` library](https://robotframework.org/robotframework/latest/libraries/Collections.html#Set%20To%20Dictionary)
68
68
69
-
`Run Process` is part of the Process library and is documented as follows:
69
+
`Set To Dictionary` is part of the Collections library and is documented as follows:
70
70
71
-

71
+

72
72
73
-
This keyword has one Mandatory Argument`command` which can be called positionally or by name.
74
-
The latter two arguments are optional.
73
+
This keyword has one :term[Mandatory Argument]`dictionary` which can be called positionally or by name. See [Mandatory Args](../chapter-03/user_keyword).
74
+
The latter two arguments are optional and can be used depending on the style of defining keys and values the user likes most.
75
75
76
-
The argument `arguments` is a :term[Variable Number of Positional Arguments] and can only be set by position.
76
+
The argument `key_value_pairs` is a :term[Variable Number of Positional Arguments] and can only be set by position.
77
77
Therefore, if it shall be set, all preceding arguments must be set by position as well.
78
78
See [2.5.2.5 Variable Number of Positional Arguments](chapter-02/05_keyword_interface.md#2525-variable-number-of-positional-arguments) for more information about this kind of argument.
79
79
80
-
The argument `configuration` is a :term[Free Named Argument] and can only be set by names.
80
+
The argument `items` is a :term[Free Named Argument] and can only be set by names.
81
+
81
82
See [2.5.2.7 Free Named Arguments](chapter-02/05_keyword_interface.md#2527-free-named-arguments) for more information about this kind of argument.
82
83
83
84
@@ -279,17 +280,26 @@ A special case of optional arguments that can only be set by their position are
279
280
These are also referred to as `*args` or `*varargs` in Python.
280
281
Some keywords need to collect a variable amount of values into one argument, because it is not possible to define the amount of values in advance.
281
282
282
-
One example for this kind of keyword is [2.5.1.2 Example Keyword `Run Process`](chapter-02/05_keyword_interface.md#2512-example-keyword-run-process) from the Process library.
283
-
This keyword executes a `command` with variable amount of `arguments` and waits for the process to finish.
284
-
Depending on the command to be executed different amount of arguments are needed for that command.
283
+
One example for this kind of keyword is [2.5.1.2 Example Keyword `Set To Dictionary`](chapter-02/05_keyword_interface.md#2512-example-keyword-set-to-dictionary) from the Collections library.
284
+
This keyword adds key and values to a `dictionary` with variable amount of `key_value_pairs`.
285
+
Depending on the number of keys and values, different amount of arguments are needed.
285
286
286
-
This variable argument is marked with a single asterisk `*` before the argument name in the keyword documentation.
287
+
This key_value_pairs argument is marked with a single asterisk `*` before the argument name in the keyword documentation.
287
288
288
-
When calling this keyword, the first positional argument is assigned to `command`, while all subsequent positional arguments are collected into `arguments`.
289
+
When calling this keyword, the first positional argument is assigned to `dictionary`, while all subsequent positional arguments are collected into `key_value_pairs`.
289
290
Because of this behavior, no additional positional arguments can be used after these :term[Variable Number of Positional Arguments].
290
291
As a result, any arguments following these :term[Variable Number of Positional Arguments] must be named arguments,
292
+
291
293
regardless of whether they are mandatory or optional arguments with a default value.
292
294
295
+
Example adding items to a dictionary using the `key_value_pairs` argument:
296
+
```robotframework
297
+
*** Test Cases ***
298
+
Dictionary Handling
299
+
VAR &{mydict}
300
+
Set To Dictionary ${mydict} key1 value1 key2 value2
301
+
```
302
+
293
303
Also see [2.5.1.3 Example Keyword `Get Regexp Matches`](chapter-02/05_keyword_interface.md#2513-example-keyword-get-regexp-matches).
294
304
295
305
@@ -334,19 +344,20 @@ In this case all values given to the keyword as arguments, that do contain an un
334
344
335
345
Free named arguments are marked with two asterisks `**` before the argument name in the keyword documentation.
336
346
337
-
The example of the `Run Process` keyword also has a free named argument `** configuration`.
347
+
The example of the `Set To Dictionary` keyword also has a free named argument `** items`.
338
348
339
-
When calling this keyword all named arguments that are not explicitly defined as argument names are collected into the `configuration` argument and will be available as a dictionary in the keyword implementation.
349
+
When calling this keyword all named arguments that are not explicitly defined as argument names are collected into the `items` argument and will be available as a dictionary in the keyword implementation.
340
350
341
351
They are optional and can be omitted.
342
352
343
-
With this configuration it is possible to e.g. redirect the output of the process to a file or to set the working directory of the process.
353
+
Using this `items` argument the key/value pairs can be given with an equal sign, like key=value.
344
354
345
-
Example redirecting stdout and stderr to a file:
355
+
Example adding items to a dictionary using the `items` argument:
346
356
```robotframework
347
357
*** Test Cases ***
348
-
Send 5 IPv4 Pings On Windows
349
-
Run Process ping -n 5 -4 localhost stdout=ping_output.txt stderr=ping_error.txt
358
+
Dictionary Handling
359
+
VAR &{mydict}
360
+
Set To Dictionary ${mydict} key1=value1 key2=value2
Copy file name to clipboardExpand all lines: website/docs/chapter-03/03_user_keyword.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -61,9 +61,9 @@ Also spaces and underscores will be ignored when matching keyword names.
61
61
So the keywords `Login To System`, and `log_into_system` are considered identical.
62
62
63
63
To identify keywords that shall be executed, Robot Framework uses a matching algorithm that is case-insensitive and ignores spaces and underscores.
64
-
-If then a full match is found, that keyword is used.
65
-
- 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.
66
-
- If still no match is found, Robot Framework tries to match the name with keywords that have embedded arguments.
64
+
-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.
65
+
- If no match is found, Robot Framework tries to match the name with keywords that have embedded arguments.
66
+
- If still no match is found, a full match (including possible Given, When, Then, And and But) is tried.
67
67
68
68
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.
0 commit comments