How can we use Set Variable if
with a keyword, where Keyword is returning a variable that needs to be Set in RobotFramework
.
Eg: ${Var} = set variable if ${i}==10 Keyword
.
Actually, the easiest way to do it is by using Run Keyword If
instead of Set Variable If
like below:
Foo
${ret}= Run Keyword If ${i} == 10 Keyword Which Return Something
Should Be Equal ${ret} something
Keyword Which Return Something
${var}= Set Variable something
[Return] ${var}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With