@@ -3,18 +3,14 @@ Boolean arguments
33
44Many keywords in Robot Framework `standard libraries `_ accept arguments that
55are handled as Boolean values true or false. If such an argument is given as
6- a string, it is considered false if it is either empty or case-insensitively
7- equal to `false ` or `no `. Other strings are considered true regardless
8- their value, and other argument types are tested using same `rules as in
9- Python `__.
6+ a string, it is considered false if it is an empty string or equal to
7+ `FALSE `, `NONE `, `NO `, `OFF ` or `0 `, case-insensitively. Other
8+ strings are considered true unless the keyword documentation explicitly
9+ states otherwise, and other argument types are tested using the same
10+ `rules as in Python `__.
1011
1112__ http://docs.python.org/library/stdtypes.html#truth-value-testing
1213
13- Keyword can also accept other special strings than `false ` and `no ` that are
14- to be considered false. For example, BuiltIn _ keyword `Should Be True ` used
15- in the examples below considers string `no values ` given to its `values `
16- argument as false.
17-
1814.. sourcecode :: robotframework
1915
2016 *** Keywords * **
@@ -29,8 +25,7 @@ argument as false.
2925 Should Be Equal ${x} ${y} Custom error values=no # Also string `no ` is false.
3026 Should Be Equal ${x} ${y} Custom error values=${EMPTY} # Empty string is false.
3127 Should Be Equal ${x} ${y} Custom error values=${FALSE} # Python `False ` is false.
32- Should Be Equal ${x} ${y} Custom error values=no values # Special false string in this context .
28+ Should Be Equal ${x} ${y} Custom error values=no values # Special false string with this keyword .
3329
34- Note that prior to Robot Framework 2.9 handling Boolean arguments was
35- inconsistent. Some keywords followed the above rules, but others simply
36- considered all non-empty strings, including `false ` and `no `, to be true.
30+ .. note :: Considering string `NONE` false is new in Robot Framework 3.0.3 and
31+ considering also `OFF ` and `0 ` false is new in Robot Framework 3.1.
0 commit comments