Updates:
Summary: It is not possible to set test/suite/global variable using an
empty list variable as a value
Status: Done
Owner: pekka.klarck
Labels: -Priority-Medium Priority-Low Target-2.1
Comment #1 on issue 280 by pekka.klarck: It is not possible to set
test/suite/global variable using an empty list variable as a value
http://code.google.com/p/robotframework/issues/detail?id=280
All these problems are due to empty list variables being handled in the
test data so
that they are pretty much ignored. That is why
| @{l}= | Create List | |
| Set Global Variable | \...@{gl} | @{l} |
is identical to
| Set Global Variable | \...@{gl} | |
which means that @{gl} variable should be set in the global scope to the
value @{gl}
currently has. If you would change @{gl} in these examples to @{non
existing} the
test would fail.
Just two days ago Juha and I looked at the code of Set Test/Suite/Global
Variable
keywords when we changed them to accept normal variables as variable names
to set
(issue 278). This change meant that these keywords get all the values in
the test
data as-is without variables being replaced (i.e. they see @{var} even if
it would be
empty). We actually happened to discuss what to do in that situation and
thought this
is such a corner case that it is better to keep the old behavior.
Apparently our
users are finding also all these corners so I changed the logic in r1759 and
| @{l}= | Create List | |
| Set Global Variable | @{gl} | @{l} |
will actuall set @{gl} to an empty list in RF 2.1 final.
In the second case you should use Crate List when assigning @{empty_list}
to a new
variable instead of Set Variable. Set Variable is meant to be used to set
only scalar
variable, and using it with any other than exactly one value has already
been
deprecated in RF 2.1 (issue 262).
--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings