${req_attribute}= Evaluate ${result_attribute}.${tgt_record.TGT_ATTR_ID}
-
1Please go over Evaluate and edit your question to be clearer.avivd– avivd2022-07-17 11:20:29 +00:00Commented Jul 17, 2022 at 11:20
-
1Please take the time to create a complete minimal reproducible example. What you're doing should work if the variables result in valid python.Bryan Oakley– Bryan Oakley2022-07-17 22:09:12 +00:00Commented Jul 17, 2022 at 22:09
Add a comment
|
1 Answer
As indicated in comment you can use Evaluate function to evaluate an expression. Expression must use Python syntax. Below is an example:
Evaluate an expression
[Tags] TestRail-C000000
${first_var} = Evaluate 2
${second_var} = Evaluate 3
${multiplication} = Evaluate ${first_var} * ${second_var}
${power} = Evaluate ${first_var} ** ${second_var}
${tuple} = Evaluate ${first_var}, ${second_var}
Log To Console ${multiplication}
Log To Console ${power}
Log To Console ${tuple}
4 Comments
The Coder
Can I Evaluate like this? ${req_attribute}= Evaluate ${result_attribute},${tgt_record.TGT_ATTR_ID} note- I changed comma instead of dot.
Dan Constantinescu
Yes, the result will be a
tuple. I'm updating the example to include this case.The Coder
Oh then how can I change that tuple into string?
Dan Constantinescu
You can use a formatted string:
${string} = Evaluate f"{${first_var}},{${second_var}}"