在Robot Framework中有条件地增加变量

时间:2017-06-29 10:16:14

标签: robotframework selenium2library

以下是我的剧本:

increment
    ${delCount}=    Set Variable    0
    :FOR    ${loopIndex}    INRANGE    0    8
    \    Log    ${loopIndex}
    \    ${delCount}=    Run Keyword If    '${loopIndex}'=='${3}'    Run Keywords    ${delCount+3}
    \    ...    ELSE IF    '${loopIndex}'=='${6}'    Run Keywords    ${delCount+6}
    \    ...    ELSE    Sleep    1s
    Log    ${delCount}

我需要做的就是在条件满足时增加变量。怎么去这个? 我在下面尝试过:

运行关键字评估$ {delCount} + $ {3}

运行关键字$ {delCount} =设置变量$ {delCount} + $ {3}

运行关键字评估$ {delCount}

2 个答案:

答案 0 :(得分:1)

像这样:

a1 = a[:,0]

答案 1 :(得分:0)

${delCount} | Set Variable If | ${loopIndex} == 3 | ${delCount} + ${loopIndex} | ${delCount}

${delCount} | Set Variable If | ${loopIndex} == 6 | ${delCount} + 6 | ${delCount}
相关问题