Hello,
I’ve got a while loop that reads a csv and then does several steps. Currently, if i have the errorignore set to True, it goes through every step before moving to the next csv line, which takes a long time.
I’d like to force reading an entirely new line if a particular step fails, rather than just timing out after each failed step. Alternatively, if errorignore is set to False, the entire macro stops. Ultimately, I’d like to be able to tell the program to move to the next row/line in csv when I want it to, after a specific task fails.
Thank you for your feedback. Here is my code:
{
“Name”: “DemoCsvReadWithLoop_turnoffupdate_new”,
“CreationDate”: “2019-3-19”,
“Commands”: [
{
“Command”: “store”,
“Target”: “fast”,
“Value”: “!replayspeed”
},
{
“Command”: “csvRead”,
“Target”: “loopingtues1.csv”,
“Value”: “”
},
{
“Command”: “while”,
“Target”: “”{!csvReadStatus}\" == \"OK\"",
"Value": ""
},
{
"Command": "store",
"Target": "true",
"Value": "!errorIgnore"
},
{
"Command": "echo",
"Target": "Status = {!csvReadStatus}, line = {!csvReadLineNumber}",
"Value": ""
},
{
"Command": "open",
"Target": "{!COL1}",
“Value”: “”
},
{
“Command”: “comment”,
“Target”: “”,
“Value”: “has opened the administrator backend”
},
{
“Command”: “type”,
“Target”: “name=rsf_backend_password”,
“Value”: “{!COL2}"
},
{
"Command": "clickAndWait",
"Target": "/html/body/div[1]/form/button",
"Value": ""
},
{
"Command": "comment",
"Target": "",
"Value": "submit button from rsfirewall, next step goes into main login"
},
{
"Command": "type",
"Target": "id=mod-login-username",
"Value": "{!COL3}”
},
{
“Command”: “type”,
“Target”: “id=mod-login-password”,
“Value”: “{!COL4}"
},
{
"Command": "clickAndWait",
"Target": "//*[@id=\"form-login\"]/fieldset/div[3]/div/div/button",
"Value": ""
},
{
"Command": "comment",
"Target": "",
"Value": "submit button from login"
},
{
"Command": "click",
"Target": "link=Extensions",
"Value": ""
},
{
"Command": "clickAndWait",
"Target": "link=Plugins",
"Value": ""
},
{
"Command": "click",
"Target": "id=filter_search",
"Value": ""
},
{
"Command": "type",
"Target": "id=filter_search",
"Value": "System - Update Notification"
},
{
"Command": "comment",
"Target": "",
"Value": "this is searching for the specific system update plugin"
},
{
"Command": "clickAndWait",
"Target": "//*[@id=\"j-main-container\"]/div[1]/div[1]/div[1]/div[1]/button",
"Value": ""
},
{
"Command": "comment",
"Target": "",
"Value": "submit button to search"
},
{
"Command": "click",
"Target": "id=cb0",
"Value": ""
},
{
"Command": "comment",
"Target": "",
"Value": "this is the checkbox for the plugin"
},
{
"Command": "click",
"Target": "//*[@id=\"toolbar-unpublish\"]/button",
"Value": ""
},
{
"Command": "comment",
"Target": "",
"Value": "this is the unpublish button"
},
{
"Command": "click",
"Target": "link=User Menu",
"Value": ""
},
{
"Command": "clickAndWait",
"Target": "link=Logout",
"Value": ""
},
{
"Command": "comment",
"Target": "",
"Value": "logs out of admin backend"
},
{
"Command": "storeEval",
"Target": "{!csvReadLineNumber}+1”,
“Value”: “!csvReadLineNumber”
},
{
“Command”: “echo”,
“Target”: "Reading CSV line No. ${!csvReadLineNumber} ",
“Value”: “!errorIgnore”
},
{
“Command”: “csvRead”,
“Target”: “loopingtues1.csv”,
“Value”: “”
},
{
“Command”: “store”,
“Target”: “false”,
“Value”: “!errorIgnore”
},
{
“Command”: “endWhile”,
“Target”: “”,
“Value”: “”
},
{
“Command”: “localStorageExport”,
“Target”: “log”,
“Value”: “”
}
]
}