I need to have a nested if statement in my test case.
I need to check if variable a equals X and if it does I need to check if variable b equals Y.
I tried doing something like this:
Click on button
Run Keyword If '${var_a}' == 'X'
... Run Keyword If '${var_b}' == 'Y'
... Click Element Locator_a
... ELSE
... Click Element Locator_b
... ELSE
... Click Element Locator_c
The error that I receive is that click element expected 1 argument and got 4.
Meaning once it returned False for the first if statement (var_a == X) it tried to call the first ELSE statement with all the later keywords as arguments (Click Element, Arg1 = locator_b, Arg2 = Else, Arg3 = Click Element, Arg5 = Locator_c).
Is there a Robot way to do this without writing a custom keywords by myself?