In my extremely limited experience, it looks like the minimum extra error handling lines to deal with storing a default value of dynamic elements (that may or may not exist) on a webpage is 4. (please guide me if I’m misunderstanding the situation)…
{ attempt to store a value/attribute…
“Command”: “storeAttribute”,
“Target”: “xpath={ixpath}[{i}]//input[@class=‘itemNumber’]@value”,
“Value”: “inumber”
},
{ go past default store if OK
“Command”: “gotoIf_v2”,
“Target”: “{!statusOK}",
"Value": "inumber-OK"
},
{ store a default value instead
"Command": "store",
"Target": "N/A",
"Value": "inumber"
},
{ skip to here if default was not needed
"Command": "label",
"Target": "inumber-OK",
"Value": ""
},
{ reset !statusOK
"Command": "store",
"Target": "true",
"Value": "!statusOK"
},
{
"Command": "storeText",
"Target": "xpath={ixpath}[${i}]//span[@class=“description”]/a”,
“Value”: “idescr”
},…
A few potential feature solutions came to mind, but since I’m not sure of where RPA stops and Selenium starts, these may be way off base, please advise.
- could you not allow synatax in a storexxx command’s value (in addition to the variable name) that represents a default value on error? This would look something like this:
{ attempt to store a value/attribute…
“Command”: “storeAttribute”,
“Target”: “xpath={ixpath}[{i}]//input[@class=‘itemNumber’]@value”,
“Value”: “(inumber, “N/A”)”
},
- To at least avoid having to repetitively add an additional command to reset !statusOK, would it be possible to key off of the unused value in label commands to do this automatically? This would look this:
{ skip to here if default was not needed
“Command”: “label”,
“Target”: “inumber-OK”,
“Value”: “!statusOK”
},
Thanks for your consideration!