I am often googling how to pass Boolean Command Line arguments in the Robot Framework when starting tests. The answer is:
False work (case is important here as this is Python).
In some earlier releases,
1 were seen as Boolean but that does not apply in the newer Robot Framework versions.
Below is an example that tests that variable
MY_BOOLEAN is Boolean type (so tests pass both with
I wanted to play with the new Python Inline Evaluation (see User Guide here) so the example has another test that uses that (both tests test exactly the same thing, the only difference is the syntax):
And to start that test,
MY_BOOLEAN is given using
robot --variable MY_BOOLEAN:False path/to/tests/
Or, in a shorter form using
robot -v MY_BOOLEAN:True path/to/tests/
Next time when I google "robot framework how to pass boolean command line arguments" I hopefully pop into this blog post 🤓. Maybe this post might also help with the concept of passing Robot Framework variables from the command line.
ps. Passing multiple arguments is done by adding multiple
robot -v MY_VARIABLE:cat -v SOME_OTHER_VARIABLE:dog path/to/tests/