${Array}.length not working

Hi everyone,
I am new to UI vision and I am failing to get a simple ${array}.length working, even using the DemoExecuteScript it doesn’t seems to work.

{
  "Name": "TestArray",
  "CreationDate": "2022-7-15",
  "Commands": [
    {
      "Command": "executeScript_Sandbox",
      "Target": "return new Array(\"Bonjour\", \"toi\", \"t'es\", \"sexy\", \"tu sais\")",
      "Value": "arr",
      "Description": ""
    },
    {
      "Command": "echo",
      "Target": "${arr}",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "executeScript_Sandbox",
      "Target": "return ${arr}.length",
      "Value": "len",
      "Description": ""
    },
    {
      "Command": "echo",
      "Target": "${len}",
      "Value": "",
      "Description": ""
    }
  ]
}

I have as a result :

[info]
Executing:  | executeScript_Sandbox | return ${arr}.length | len | 
[info]
Executing:  | echo | ${len} |  | 
[echo]
undefined

I’ve been banging my head on this for way too long, any ideas would be much appreciated.

Thank you

Use executeScript instead of executeScript_Sandbox

Latest version (at time of me writing) has a bug with Arrays and executeScript_Sandbox:

https://ui.vision/rpa/docs/selenium-ide/executescript#arrays

1 Like

That works, thanks a lot, I wouldn’t have found this by myself

In the new release V7.1.12 the array issue is fixed, so using executeScript_Sandbox works again.

1 Like