Hi everyone ![]()
I am using Katalon recorder and I need to write an if-else condition so that a checkbox will be selected only if it is not already selected. I have used the variable “StateChx” to store the value True/False of the checkbox state.
Everything seems working fine but I get the error: SyntaxError: Unexpected token ‘{’ when Katalon runs the if command.
Can you please help with this?
Thanks.
here are the steps:
storeChecked | id=internalColor0 | StateChx
echo | | ${StateChx}
if | $ {StateChx} |
click | //*[@data-validationcode=“optionals”] |
else | |
click | id=internalColor0 |
Here the log:
[info] Executing: | storeChecked | id=internalColor0 | StateChx |
[info] Store ‘false’ into ‘StateChx’
[info] Executing: | echo | | ${StateChx} |
[info] Expand variable ‘${StateChx}’ into ‘false’
[info] Executing: | if | $ {StateChx} | |
[error] SyntaxError: Unexpected token ‘{’
[info] Test case failed
