Retry same CSV-line after error

Hi all,

After hours of trying I cant seem to figure out the following:

I have a CSV of about 500 lines.
If there is an error (like error 101: UI.Vision RPA is not connected to a browser tab) I want to retry the same CSV line.

I used to do this with the storeEval command, but its been deprecated and I cant work out what to change. I know I need to use the executeScript but its just not working.

Can anyone see the problem?

{
“Name”: “FLEXICHECK_CSV”,
“CreationDate”: “2020-9-14”,
“Commands”: [
{
“Command”: “open”,
“Target”: “Site”,
“Value”: “”
},
{
“Command”: “if_v2”,
“Target”: “{!loop}==1", "Value": "" }, { "Command": "store", "Target": "1", "Value": "globalCurrentLineToRead" }, { "Command": "end", "Target": "", "Value": "" }, { "Command": "csvRead", "Target": "excel flexicheck.csv", "Value": "" }, { "Command": "type", "Target": "id=idinss", "Value": "{!COL1}”
},
{
“Command”: “clickAndWait”,
“Target”: “id=next”,
“Value”: “”
},
{
“Command”: “select”,
“Target”: “id=comSelect”,
“Value”: “index=1”
},
{
“Command”: “select”,
“Target”: “id=typeSelect”,
“Value”: “index=3”
},
{
“Command”: “clickAndWait”,
“Target”: “id=next”,
“Value”: “”
},
{
“Command”: “click”,
“Target”: “id=idflexiRadioButtonsOnStep3_D”,
“Value”: “”
},
{
“Command”: “click”,
“Target”: “id=iddateFlexi”,
“Value”: “”
},
{
“Command”: “type”,
“Target”: “id=iddateFlexi”,
“Value”: “01/10/2020”
},
{
“Command”: “type”,
“Target”: “id=startTime0”,
“Value”: “10:00”
},
{
“Command”: “type”,
“Target”: “id=endTime0”,
“Value”: “18:00”
},
{
“Command”: “click”,
“Target”: “id=next”,
“Value”: “”
},
{
“Command”: “verifyElementPresent”,
“Target”: “xpath=//[@id=“wizard”]/div/div[2]/div/div/div/div[2]/ul/li",
“Value”: “”
},
{
“Command”: “if_v2”,
“Target”: “{!LastCommandOK}", "Value": "{!statusOK}”
},
{
“Command”: “storeText”,
“Target”: “id=joinCommission”,
“Value”: “!csvLine”
},
{
“Command”: “storeText”,
“Target”: “id=inss”,
“Value”: “!csvLine”
},
{
“Command”: “storeText”,
“Target”: "xpath=//
[@id=“wizard”]/div/div[2]/div/div/div/div[2]/ul/li”,
“Value”: “!csvLine”
},
{
“Command”: “csvSave”,
“Target”: “excel flexicheck - Output.csv”,
“Value”: “”
},
{
“Command”: “else”,
“Target”: “”,
“Value”: “”
},
{
“Command”: “storeText”,
“Target”: “id=workerType”,
“Value”: “!csvLine”
},
{
“Command”: “storeText”,
“Target”: “id=inss”,
“Value”: “!csvLine”
},
{
“Command”: “storeText”,
“Target”: “id=workerType”,
“Value”: “!csvLine”
},
{
“Command”: “csvSave”,
“Target”: “variabele excel flexicheck - Output.csv”,
“Value”: “”
},
{
“Command”: “end”,
“Target”: “”,
“Value”: “”
},
{
“Command”: “executeScript_Sandbox”,
“Target”: “${globalCurrentLineToRead}+1”,
“Value”: “globalCurrentLineToRead”
}
]
}

UI.Vision used with Chrome 85.0.4183.102
Win10
Ui.Vision 5.8.8

Thank you in advance!

Edit: Software used

This is an hard error when you see this error “error 101: UI.Vision RPA is not connected to a browser tab” you must close browser and ui vision rpa and restart macro, there is not a solution to bypass this error.

From the moment you see “error 101: UI.Vision RPA is not connected to a browser tab” all your macro can not continue to work, must close browser and ui vision.

The solution to continue a csv line is save current line in another csv and restart macro checking the last line used saves in a csv.

Thanks for the quick response.

Yeah, the 101-error is quite the bitch. I’ve used this Macro for about 2 years and now I get the 101 error all a sudden. I think its a problem with UI.Vision and not with the Macro.

But the real problem I’m having is that I can’t seem to get to continue the CSV-line with the new “executeScript”-command. I just don’t know how I can save the CSV line now…

To solve this problem you need to use these steps

save current line in a csv (for every loop)
read last line of csv with line number
start macro with line saved in csv

You must use:

csvSave to save current line of csv used (in another csv)
!csvReadMaxRow to read last line in csv
!csvReadLineNumber to set the line to start your macro

You must switch with csvRead command from 2 csv in your macro to do this.