Hello,
So I have a script where I loop through a csv file which contain many accounts login information. I use those to login to a site then write data to another csv file. The issue is if the login doesnt work or if there is another error, I still want to write to the csv (but with a specific error) then continue to the next account.
However, the commands under the “error” label are always read by the script. How do I isolate them so they are only read when theres an error and the the loop continue as usual?
My script goes something like this:
"Commands": [
{
"Command": "csvRead",
"Target": "accounts.csv",
"Value": "",
"Description": ""
},
{
"Command": "while_v2",
"Target": "${!csvReadStatus} == \"OK\"",
"Value": "",
"Description": ""
},
Then I do some stuff and verify if an element is present, if it is I want to go into my “error handling” label “cannotLogin” and it works fine but the issue is that if the error is not present the commands under the label “cannotLogin” still run.
{
"Command": "verifyElementPresent",
"Target": "id=errorList",
"Value": "",
"Description": ""
},
{
"Command": "gotoIf_v2",
"Target": "${!statusOK}",
"Value": "cannotLogin",
"Description": ""
},
Its probably easier with screenshot so heres the whole thing. Im new at this so Im probably missing something obvious but the question is how do I handle a different error path inside a while loop so the commands under that label are only ran when theres is an error and the loop continues afterwhich.
Thank you