Even if the IF condition is wrong it is not going to else part script fails in IF statment itself

Even if the IF condition is wrong it is not going to else part script fails in IF statment itself

I have my robot framework code as
i have conditional if else statement in robot framework
IF ${string}== ‘[’,deijfe]’
Click Element xpath= //div[sjd’[1]‘]
ELSE
Click Element xpath= //div[kefm’[2]‘]
END
even if the if satement does not match it is not skipping IF part it gooees through same Click Element xpath= //div[sjd’[1]']

can you please help me out

You probably have an error in the IF condition, and it was not evaluated. Am I right?

Try to edit your question and use the formatting option. This is a small test you can do:

IF  "‘[’,deijfe]’" == "‘[’,deijfe]’"
    Log to Console    If branch
ELSE
    Log to Console    Else branch
END
2 Likes