我正在尝试创建元组列表以进一步在RF中进行细化,但只能使用Create List
关键字来管理字符串列表:
*** Test cases ***
Tuple list test
@{tuples_list}= Create List ('1','one') ('2','two') ('3','three')
Log ${tuples_list}
这样,每个元组都是一个字符串,就像在日志中一样:
[“(''1','one')”,“('2','two')”,“('3','3')”]]
是否可以在不将每对转换为字符串的情况下创建元组列表?
您可以使用Robot的新功能(自3.2版开始)内嵌python评估功能:
@{tuples_list}= Set variable ${{ [('1', 'one'), ('2', 'two'), ('3', 'three')] }}
-要么-
@{foo}= Create list
... ${{ ('1', 'one') }}
... ${{ ('2', 'two') }}
... ${{ ('3', 'three') }}
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句