You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally submitted to Google Code by andrey.hitrin on 21 Mar 2014
Hello!
Documentation for the keyword 'Run Keyword And Return' claims that following code samples should be equivalent to each other:
Run Keyword And Return My Keyword arg1 arg2
and
${result} = My Keyword arg1 arg2
Return From Keyword ${result}
But it is not true when "My Keyword" returns string that contains some text that may look like Robot Framework variable. In the attached file I demonstrate an example of this. Looks like keyword "Run Keyword And Return" not just simply return given value, but also tries to evaluate it.
What I've got:
$ pybot test.txt
Test
Direct Call With "[Return]" Works Fine | PASS |
Direct Call With "Return From Keyword" Works Fine | PASS |
Old-Fashion Wrapping Works Fine | PASS |
New-Fasion Wrapping Fails | FAIL |
Replacing variables from keyword return value failed: Resolving variable '${client-email}' failed: Non-existing variable '${client}'.
The problem is that Run Keyword And Return doesn't escape return values it gets before internally using Return From Keyword to actually return the value. The bug doesn't only cause problems with strings that contain variable syntax, like ${client-email} in the original description, but also any usage of backslashes. Backslashes are unescaped and thus e.g. returned c:\temp turns into c:<tab>emp.
Hello!
Documentation for the keyword 'Run Keyword And Return' claims that following code samples should be equivalent to each other:
and
But it is not true when "My Keyword" returns string that contains some text that may look like Robot Framework variable. In the attached file I demonstrate an example of this. Looks like keyword "Run Keyword And Return" not just simply return given value, but also tries to evaluate it.
What I've got:
$ pybot test.txt
Test
Direct Call With "[Return]" Works Fine | PASS |
Direct Call With "Return From Keyword" Works Fine | PASS |
Old-Fashion Wrapping Works Fine | PASS |
New-Fasion Wrapping Fails | FAIL |
Replacing variables from keyword return value failed: Resolving variable '${client-email}' failed: Non-existing variable '${client}'.
Test | FAIL |
4 critical tests, 3 passed, 1 failed
#4 tests total, 3 passed, 1 failed
$ pybot --version
Robot Framework 2.8.4 (Python 2.7.5+ on linux2)
The text was updated successfully, but these errors were encountered: