ReferenceError: text2 is not defined

I first added a variable called “randomvar” with as value “text2”

I then added a new test line:
Command: if
Target: ${randomvar} == “newtext”

When I run the test, I get following log and error:

[info] Executing: | if | ${randomvar} == “newtext” | |

[info] Expand variable ‘${randomvar} == “newtext”’ into ‘text2== “newtext”’

[error] ReferenceError: text2 is not defined

Why does he say text2 is not defined, as it’s just a variable’s value?

Please wrap ${randomva} inside double quotes and see if it works.

"${randomvar}" == "newtext"
1 Like