IF ELSE in robot framework with variables assignment

前端 未结 4 1224
广开言路
广开言路 2021-02-07 11:41

I need to execute some keywords conditionally in robot framework, but I dont know how to do it, it does not work. I tried many options, but I guess I have the \"IF-ELSE\" statem

4条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-07 12:17

    ${error_status} Set Variable    False       
    log ${error_status}         
    Run Keyword If  ${error_status} calltrue    ELSE    login_sucessful
    
    calltrue and login_sucessful are keywords it can be any keyword of your choice. so in this case login_sucessful  keyword is executed. if error_status is set to true then calltrue function will get executed.
    

    Please be careful about the indentation a single space will mess up your execution flow

提交回复
热议问题