user188496
user188496

Reputation: 9

validate test case result in robot framework

I am trying to write a automated script using robot framework integrated with sikuli.

Script is as below.

${var}= Get Match Score Image.png         
Run keyword if ${var} log to console ImageMatched ElSE log to console ImageDidNotMatch             

... followed by some commands

Everytime the image is not matched and the ELSE condition is executed. However, the result is always Pass. I want to know what parameter/value is checked to pass the test case. if i know which parameter is being checked for making the result pass or fail then i guess, i can make it fail.

Need your expert advice.

Thanks in advance.

Upvotes: 0

Views: 1162

Answers (1)

Psytho
Psytho

Reputation: 3384

The result is always PASS because your IF-ELSE path is always executed without errors - the image either matches or not. And you don't say in which case your test should fail

If you want your test to fail if the image does not match, you can use keyword "FAIL":

Run keyword if    ${var}    log to console    ImageMatched 
       ELSE       Fail

Or even more simpler: just don't use the IF-ELSE at all. You can use Should Be True or Should Be Equal.

Upvotes: 3

Related Questions