79111075

Date: 2024-10-21 17:11:44
Score: 0.5
Natty:
Report link

Both these keywords can be combined. Please refer to the example below

RunKeywordstest
[Tags]    t1
${var_true}=    Set Variable    True
${var_true}=    Convert to Boolean    ${var_true}
${var_false}=    Set Variable    False
${var_false}=    Convert to Boolean    ${var_false}
${status_var}=    Run Keyword If    ${var_true}
...               Run Keyword and Return Status    Should Be Equal    2  2
# Should be True
Log    ${status_var}
${status_var}=    Run Keyword If    ${var_true}
...               Run Keyword and Return Status    Should Be Equal    2  1
# Should be False
Log    ${status_var}
${status_var}=    Run Keyword If    ${var_false}
...               Run Keyword and Return Status    Should Be Equal    2  2
# Should be None as due to var_false, next line wouldn't run
Log    ${status_var}

Output: Code Output

Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Anuj Kalra