使用 RIDE 编辑器在 RF 中创建列表

Creating a List in RF using RIDE editor

基本上我正在尝试使用内置库中的创建列表关键字来制作列表 ${strValue} 创建列表 q r s 1

我得到一个输出 [u'q', u'r', u's', u'1']

我实际上是在寻找要打印的输出 [q, r, s, 1]

您永远不会让输出看起来像 [q, r, s, 1],因为那不是 python 列表的工作方式。

但是,您可以轻松创建自己的函数,该函数采用列表变量和 returns 该格式的字符串。

例如:

*** Test cases ***
Example
    ${data}=     create list    q  r  s  1
    ${converted}=    convert list data    ${data}
    should be equal as strings    ${converted}    [q, r, s, 1]

*** Keywords ***
convert list data
    [Arguments]   ${list}
    ${result}=    evaluate    "[" + ", ".join($list) + "]"
    [return]      ${result}