--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To post to this group, send email to robotframe...@googlegroups.com.
To unsubscribe from this group, send email to robotframework-u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/robotframework-users?hl=en.
I'm assuming now that you are expecting similar behavior as in Excel:
Cell value is a function that changes whenever the argument values
change.
If this is not what you are expecting then ignore this explanation.
Robot doesn't work like Excel. The variables work the way they work in
most programming languages. In other words what you write in to the
variable table cell as a value is the variables value only at the
beginning -- it will not be read again during the test execution.
To change a variables value you can do this:
*** Variables ***
${a} ${1} # Initializes ${a} to number 1
*** Test Cases ***
Test
Log ${a} # on this line ${a} is 1
${a}= Set Variable ${a+3} # After this line ${a} is ${value of
'a' before this row + 3} == ${1+3} == ${4} == number 4
Log ${a} # on this line ${a} is 4
The other thing worth of noting is that you can't use variables before
they have been defined:
In your example ${b} is not defined when a + '\${b}' is set as value of ${a}.
Also the '\' will escape '$'-sign so this will never use the value of
${b} and will just write 'a+${b}'.
Kind regards,
Mikko Korpela
2011/8/16 wu feng <mrbi...@gmail.com>:
There's BuiltIn keyword 'Replace Variables' that ought to work in this
case. Assuming you have ${url} variable with the above shown content,
and variables ${value1} and ${value2} have some value, you can use it
like:
| ${url2} = | Replace Variables | ${url} |
Notice that if you set different values for ${value1} and ${value2},
the result you get from 'Replace Variables' also changes.
Cheers,
.peke
--
Agile Tester/Developer/Consultant :: http://eliga.fi
Lead Developer of Robot Framework :: http://robotframework.org