The for “foreach” command does not recognize my array.
I copied the example as shown forEach Flow Control - Selenium IDE Commands Tutorial and get the error “target must be an array” when it hits the foreach command.
In fact I’m able to access able to access the 2nd element of the array variable directly but the forEach command does not recognize my array variable as an array.
I’m on version 5.5.7
I think there is a bug.
Here is my code:
{
"Name": "Test 3",
"CreationDate": "2020-4-7",
"Commands": [
{
"Command": "executeScript_Sandbox",
"Target": "return [\"Hello\",\"Bonjour\",\"Hi\"];",
"Value": "A1"
},
{
"Command": "echo",
"Target": "${A1[2]}",
"Value": ""
},
{
"Command": "forEach",
"Target": "${A1}",
"Value": "greeting"
},
{
"Command": "echo",
"Target": "${greeting} and have a nice day!",
"Value": ""
},
{
"Command": "end",
"Target": "",
"Value": ""
}
]
}