Hello. I have an automation that I am trying to create that will scan all open tabs in a browser window for one with a title that matches a particular wildcard expression. The selectWindow action almost provides the functionality that I am looking for as far as being able to select a tab whose title matches a wildcard expression, but only works if a tab matching the provided wildcard expression exists, and I want to create a function that can account for the scenario where the tab does not exist. Therefore, in order to accomplish this, I figured my best bet was to use error handling (with the "!statusok internal variable in a conditional statement) in conjunction with the selectWindow action to achieve the desired result. Below is the json source of the automation that I currently am running to give you a better idea as to what I am trying to achieve:
{
"Name": "f5",
"CreationDate": "2024-1-18",
"Commands": [
{
"Command": "store",
"Target": "!errorignore",
"Value": "true",
"Description": ""
},
{
"Command": "bringBrowserToForeground",
"Target": "",
"Value": "",
"Description": ""
},
{
"Command": "selectWindow",
"Target": "title=*BIG-IP*",
"Value": "",
"Description": ""
},
{
"Command": "if",
"Target": "${!statusOK} == false",
"Value": "",
"Description": ""
},
{
"Command": "selectWindow",
"Target": "TAB=OPEN",
"Value": "https://10.40.0.4/",
"Description": ""
},
{
"Command": "waitForPageToLoad",
"Target": "4000",
"Value": "",
"Description": ""
},
{
"Command": "end",
"Target": "",
"Value": "",
"Description": ""
},
{
"Command": "pause",
"Target": "",
"Value": "",
"Description": ""
}
]
}
However, despite the fact that I have set the !ErrorIgnore internal variable to true to prevent errors from terminating the automation, the error returned by the selectWindow action terminates the automation anyway in the event that a tab matching the defined wildcard expression does not exist in the browser:
Why is this happening? Am I doing something wrong? Or Is there a better/easier way to implement what I am trying to accomplish?