Hello,
The executeScript_Sandbox
command errors when null
is in the return value or just removes them from nested arrays.
On the contrary, executeScript
commands handles them just fine.
Test Environment/s
Chrome on Linux with UI.Vision V1.9.5
No XModules installed
Clean Profile (i.e., no other extensions installed, clean cookies and history, all default settings)
Edge on Windows 10 with UI.Vision V1.9.3
No XModules installed
Expected Behavior: Handle and return null
as it is done by ExecuteScript
Observed Behavior: Errors on “null” and if returning a nested array removes all null
elements within the nested array.
Test Macro:
{
"Name": "NullStripper",
"CreationDate": "2024-4-17",
"Commands": [
{
"Command": "executeScript_Sandbox",
"Target": "return [[1,null,3,null,5,null,7,null,9]];",
"Value": "NS_ARRAY",
"Description": "This will write a nested array to NS_ARRAY but will remove all nulls and mess up the positions of the elements."
},
{
"Command": "executeScript_Sandbox",
"Target": "return [420,69,null];",
"Value": "",
"Description": "This line will throw an error."
},
{
"Command": "executeScript_Sandbox",
"Target": "return null;",
"Value": "",
"Description": "This line will also throw an error"
}
]
}
WORKAROUND:
For now, the workaround on this is to return the JSON wrapped version with JSON.stringify. Then, use JSON.parse to unwrap it on the next executeScript*.
Or, just use the regular executeScript
, or avoid having your executeScript_Sandbox
commands return null?