首页 > 其他 > 详细

RF的Collections标准库

时间:2020-05-24 15:16:12      阅读:64      评论:0      收藏:0      [点我收藏+]
Collections:针对List和Dict的处理
想看更为全面的可以参考官网:http://robotframework.org/robotframework/latest/libraries/Collections.html

可以添加Append to list和移除Remove From List和创建Set List Value
*** Settings ***
Library   Collections

*** Variables ***
&{dict2}    id=1
&{dict3}    id=2
*** Keywords ***
getappendlist
    ${str1}  create list
    Append to list  ${str1}  ${dict2}  ${dict3}
    log to console  ${str1}
getsetlist
    ${str2}  create list
    Append to list  ${str2}  1   2   3
    #修改list中的值
    Set List Value   ${str2}   1    b
    Set List Value   ${str2}   -1    c
    LOG TO CONSOLE   ${str2}
getremovelist
    ${str3}  create list
    Append to list  ${str3}  4   5   8
    log to console  ${str3}
    ${x}  remove from list  ${str3}    1
    log to console  ${str3}
*** Test Cases ***
case1--列表追加
    getappendlist
case2--列表修改
    getsetlist
case3--列表根据下标删除
    getremovelist

 

 技术分享图片

 

 


 

RF的Collections标准库

原文:https://www.cnblogs.com/Lara1798/p/12951038.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!