I’m trying to do a looping infinity reading a CSV file. However, once the variable !csvReadStatus is equal to “end_of_file” and it is read-only a can’t start reading the file again. How can I do to read the file 2nd time, 3rd time and so on… in a looping infinity that only will stop when stop the macro on console.
{
“CreationDate”: “2018-5-25”,
“Commands”: [
{
“Command”: “store”,
“Target”: “120”,
“Value”: “!timeout_macro”
},
{
“Command”: “store”,
“Target”: “fast”,
“Value”: “!replayspeed”
},
{
“Command”: “label”,
“Target”: “start”,
“Value”: “”
},
{
“Command”: “store”,
“Target”: “1”,
“Value”: “!csvReadLineNumber”
},
{
“Command”: “store”,
“Target”: “OK”,
“Value”: “!csvReadStatus”
},
{
“Command”: “echo”,
“Target”: “— Read CSV Test starts here —”,
“Value”: “”
},
{
“Command”: “label”,
“Target”: “TESTSTART”,
“Value”: “”
},
{
“Command”: “csvRead”,
“Target”: “ReadCSVTestData.csv”,
“Value”: “”
},
{
“Command”: “echo”,
“Target”: “Status = ${!csvReadStatus}, line = ${!csvReadLineNumber}”,
“Value”: “”
},
{
“Command”: “while”,
“Target”: “"${!csvReadStatus}" == "OK"”,
“Value”: “”
},
{
“Command”: “echo”,
“Target”: “status = ${!csvReadStatus}, line = ${!csvReadLineNumber}”,
“Value”: “”
},
{
“Command”: “store”,
“Target”: “true”,
“Value”: “!errorIgnore”
},
{
“Command”: “storeAttribute”,
“Target”: “//div[@class=‘giveHeight’]/table/tbody/tr/td[text()=${!COL1}]/following-sibling::td[text()=${!COL2}]/following-sibling::td/a@href”,
“Value”: “url”
},
{
“Command”: “if”,
“Target”: “${!LastCommandOK}”,
“Value”: “”
},
{
“Command”: “selectWindow”,
“Target”: “tab=open”,
“Value”: “https://www.carsarrive.com${url}”
},
{
“Command”: “clickAndWait”,
“Target”: “css=input.button”,
“Value”: “”
},
{
“Command”: “selectWindow”,
“Target”: “tab=0”,
“Value”: “”
},
{
“Command”: “selectWindow”,
“Target”: “tab=closeallother”,
“Value”: “”
},
{
“Command”: “endif”,
“Target”: “”,
“Value”: “”
},
{
“Command”: “storeEval”,
“Target”: “${!csvReadLineNumber}+1”,
“Value”: “!csvReadLineNumber”
},
{
“Command”: “store”,
“Target”: “true”,
“Value”: “!errorIgnore”
},
{
“Command”: “echo”,
“Target”: "Reading CSV line No. ${!csvReadLineNumber} ",
“Value”: “!errorIgnore”
},
{
“Command”: “csvRead”,
“Target”: “ReadCSVTestData.csv”,
“Value”: “”
},
{
“Command”: “store”,
“Target”: “false”,
“Value”: “!errorIgnore”
},
{
“Command”: “endWhile”,
“Target”: “”,
“Value”: “”
},
{
“Command”: “store”,
“Target”: “true”,
“Value”: “!errorIgnore”
},
{
“Command”: “refresh”,
“Target”: “”,
“Value”: “”
},
{
“Command”: “gotoLabel”,
“Target”: “start”,
“Value”: “”
}
]
}