Reputation: 3
I am trying to evaluate below expression in Robot framework
Run Keyword If '${buttondisplayed}' == 'PASS' and '${ReturnedInfo}' == ' PASS', Some Keyword,
else if, '${buttondisplayed}' == 'PASS' and '${ReturnedInfo}' == 'FAIL', Some Keyword ,
else if, '${buttondisplayed}' == 'FAIL' and '${ReturnedInfo}' == 'PASS', Some Keyword,
else, Some Keyword
Where the value of both ${buttondisplayed} and ${ReturnedInfo} = FAIL.
Based on above condition, else part mentioned, in the end, should be executed however in Log output I am getting the following result
Documentation:
Runs the given keyword with the given arguments, if the condition is true.
Start / End / Elapsed: 20170806 11:15:14.448 / 20170806 11:15:14.448 / 00:00:00.000
So basically none of the conditions is executed here. Could anyone please indicate what is wrong here in this expression?
Upvotes: 0
Views: 7631
Reputation: 2457
Run Keyword If '${buttondisplayed}'=='PASS' and '${ReturnedInfo}'=='PASS' Some Keyword
... ELSE IF '${buttondisplayed}'=='PASS' and '${ReturnedInfo}'=='FAIL' Some Keyword
... ELSE IF '${buttondisplayed}'=='FAIL' and '${ReturnedInfo}'=='PASS' Some Keyword
... ELSE Some Keyword
Upvotes: 1
Reputation: 386342
There are at least four problems with the code you've posted:
ELSE IF
)...
Upvotes: 2