I updated the above example to use the new commands such as csvReadArray, executeScript_Sandbox and forEach:
{
"Name": "url from csv",
"CreationDate": "2021-7-19",
"Commands": [
{
"Command": "csvReadArray",
"Target": "url.csv",
"Value": "myCSV",
"Description": ""
},
{
"Command": "echo",
"Target": "Number of rows = ${!CsvReadMaxRow}",
"Value": "green",
"Description": ""
},
{
"Command": "executeScript_Sandbox",
"Target": "return ${mycsv[0]}.length;",
"Value": "col",
"Description": ""
},
{
"Command": "echo",
"Target": "Number of columns = ${col}",
"Value": "pink",
"Description": ""
},
{
"Command": "comment",
"Target": "loop over all CSV values in the array",
"Value": "",
"Description": ""
},
{
"Command": "forEach",
"Target": "myCSV",
"Value": "row",
"Description": "With each loop, we copy a new arraw ROW into the ${row[0] variable"
},
{
"Command": "echo",
"Target": "url is ${row[0]}",
"Value": "brown",
"Description": ""
},
{
"Command": "open",
"Target": "${row[0]}",
"Value": "",
"Description": ""
},
{
"Command": "executeScript_Sandbox",
"Target": "var string = ${row[0]}; var stripped = string.replace(/[^A-Za-z0-9]/g, ''); return stripped;",
"Value": "alphanumericonly",
"Description": "Remove non alphanumeric chars from URL, so we can use it as screenshot file name"
},
{
"Command": "captureScreenshot",
"Target": "screenshot_for_${alphanumericonly}",
"Value": "",
"Description": ""
},
{
"Command": "end",
"Target": "",
"Value": "",
"Description": ""
}
]
}