How to force UI to retry opening a URL in case of a timeout?

I’m trying to read and open URLs from a CSV file in a loop. However, sometimes my Internet connection is spotty or the destination website just temporarily won’t load.

Is there a way I can force UI.vision to keep retrying the last URL it read from my CSV file in case the pageload times out?

I tried to set a label to jump into in case the !statusOK becomes false from a URL timeout, but this doesn’t seem to work. Instead of jumping to my label and retrying the page load, UI Vision just starts with the next full loop.

Any ideas or advice would be appreciated.

Thanks.

My current non-working steps:

{
“Name”: “Main Scrape test”,
“CreationDate”: “2021-8-19”,
“Commands”: [
{
“Command”: “csvRead”,
“Target”: “Missing URLS.csv”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “store”,
“Target”: “${!col1}”,
“Value”: “currentUrl”,
“Description”: “”
},
{
“Command”: “label”,
“Target”: “RESET”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “store”,
“Target”: “true”,
“Value”: “!statusOK”,
“Description”: “”
},
{
“Command”: “open”,
“Target”: “${currentUrl}”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “gotoIf_v2”,
“Target”: “${!statusOK} == false”,
“Value”: “RESET”,
“Description”: “”
},

With if_v2 and statusok you can check this and retry the command

Thank you for the advice. I’ll give this a try.

Just to confirm, I should be using If_v2 instead of gotoIf_v2?

gotoIf_v2 is a quicker way, it’s fine, i suppose you already have saved a true to errorIgnore
I actually don’t see a problem with your code as it is in the question

Thank you, you’re right…I was missing an errorIgnore setting. It’s working now. :slight_smile:

“Name”: “Main Scrape-2 test”,
“CreationDate”: “2021-8-21”,
“Commands”: [
{
“Command”: “csvRead”,
“Target”: “missed uniques.csv”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “store”,
“Target”: “${!col1}”,
“Value”: “currentUrl”,
“Description”: “”
},
{
“Command”: “store”,
“Target”: “true”,
“Value”: “!errorIgnore”,
“Description”: “”
},
{
“Command”: “label”,
“Target”: “RESET”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “store”,
“Target”: “true”,
“Value”: “!statusOK”,
“Description”: “”
},
{
“Command”: “open”,
“Target”: “${currentUrl}”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “gotoIf_v2”,
“Target”: “${!statusOK} == false”,
“Value”: “RESET”,
“Description”: “”
},
{
“Command”: “store”,
“Target”: “${!col1}”,
“Value”: “!csvLine”,
“Description”: “”
},

1 Like