Error: Variable not defined when running a If command

Hi!

I am having a error “variable data_val is not defined”, When I try to run a if command in Selenium IDE. I can’t understand this error, because I can read the variable before the If command to be executed.
I’ve already clean the cache of my browser.

Best,
Leonardo Falcão

Selenium error if2
Selenium error if1
Selenium error if
Best,
Leonardo Koblitz

Hi, I agree that should not happen. Can you please post a test macro for this issue?

My test works fine:

{
  "Name": "if",
  "CreationDate": "2020-5-28",
  "Commands": [
    {
      "Command": "store",
      "Target": "123",
      "Value": "a"
    },
    {
      "Command": "comment",
      "Target": "pause // 0",
      "Value": ""
    },
    {
      "Command": "echo",
      "Target": "${a}",
      "Value": ""
    },
    {
      "Command": "if_v2",
      "Target": "${a}==\"\"",
      "Value": ""
    },
    {
      "Command": "echo",
      "Target": "empty",
      "Value": ""
    },
    {
      "Command": "end",
      "Target": "",
      "Value": ""
    }
  ]
}

Hi!,
I’ve executed your script and it is ok. Thanks.
Nevertheless, the error persist. I’ve put part of your code inside my code, but I got the same error.
I will try to make a new macro and insert my code to see if it is a bug.
Thanks again.

Selenium error if3 Selenium error if4

I finally solve this error. I’ve deleted the command and insert another with the same instructions of the previus command.
Thanks to all.

Hi can you post the macro code to help other users with same problem please ?

Thanks