Return Robot Framework 中的两个值

Return two values in Robot Framework

Robot Framework 中是否有可能 return 两个变量?

${result1}, ${result2}=    MyKeyword

无效。

删除 ,

${result1}    ${result2}    =    MyKeyword

是的,只需将变量放在单独的单元格中,无论是在赋值时还是在返回值时。

例如:

*** Test Case ***
Example
    ${value1}    ${value2}    return two values
    Should be equal    ${value1}    this is value 1
    Should be equal    ${value2}    this is value 2


*** Keywords ***
Return two values
    ${v1}=      set variable    this is value 1
    ${v2}=      set variable    this is value 2

    [Return]    ${v1}    ${v2} 
${result1}    ${result2} =    MyKeyword

对我有用。

${result1}    ${result2}    =    MyKeyword

给我:

No keyword with name '=' found.

以防万一,我只使用空格,没有制表符。