python3+robot 之For循环

For循环

函数结构范例:

:For 变量  IN  序列(or 列表)

     关键字 参数值

例子1:

${name}    evaluate    ['test1','test2','test3']
log type(${deleteReq.content})
:for ${i} in ${name}
\ should be byte string ${deleteReq.content} ${i}

 

:For 变量  IN RANGE 循环限量

     关键字  参数值

例子2;

:FOR    ${i}    IN RANGE    5
\ ${neClasses} set variable test${i}
\ ${param} Create Dictionary id= loginName=test${i}

例子3:第一个参数7 作为开始数字, 第二个参数700-1作为结束数字
:for  ${i}  in range    7    700
\ should be byte string ${deleteReq.content} test${i}
posted @ 2020-05-20 07:27  定静沉行  阅读(557)  评论(0编辑  收藏  举报