Also, I found that the store attribute solution as suggested by @erdomay7 works as well, once you find the right xpath.
In our case we need the one with the /a
at the end. It contains the href
attribute:
So this works:
- extract URL with “store attribute @href”
- Split string to get ID
- Combine the “View.aspx” base URL with ID
- Open new tab with selectWindow | Tab=Open
See here:
Macro:
{
"Name": "storeattribute",
"CreationDate": "2021-10-5",
"Commands": [
{
"Command": "storeAttribute",
"Target": "xpath=//tr[4]/td[4]/a@href",
"Value": "a",
"Description": ""
},
{
"Command": "echo",
"Target": "${a}",
"Value": "blue",
"Description": ""
},
{
"Command": "executeScript_Sandbox",
"Target": "return ${a}.split(\"=\")[1].trim();",
"Value": "b",
"Description": ""
},
{
"Command": "echo",
"Target": "${b}",
"Value": "green",
"Description": ""
},
{
"Command": "selectWindow",
"Target": "TAB=OPEN",
"Value": "https://go.xero.com/AccountsReceivable/View.aspx?InvoiceID=${b}",
"Description": ""
}
]
}