I need to storetext the words “Showing 1 – variable number of variable number”
Ex: “Showing 1 – 2 of 2” It is not a link to click. I’ve tried highlighting the words, but the location keeps changing. When I highlight the words and “inspect” below is what I see:
Below is what I have tried:
{
"Command": "storeAttribute",
"Target": "“//*[text()=\"page-tools__count\"]@span”,",
"Value": "vDeviceCt",
"Description": ""
},
{
"Command": "echo",
"Target": "${vDeviceCt}",
"Value": "",
"Description": ""
},
{
"Command": "executeScript_Sandbox",
"Target": "return ${vDeviceCt}.split(\"of \")[1].trim();",
"Value": "vDeviceCtAll",
"Description": ""
},
{
"Command": "echo",
"Target": "${vDeviceCtAll}",
"Value": "",
"Description": ""
},
{
"Command": "executeScript_Sandbox",
"Target": "return ${vDeviceCtAll}.split(\"\\n\")[0].trim(); ",
"Value": "vDeviceCt",
"Description": ""
},
{
"Command": "echo",
"Target": "${vDeviceCt}",
"Value": "",
"Description": ""
},
The bottom line of what I’m trying to do is find within a table a device number, which could be at any location in the table. Then click the link to the far-left column of where the device number is located (however, the device number is not a link to click).
Therefore, I’m using the row count {r} of the table to find the row of the device and then enter that row number as a variable into an xpath to get to the site that I need, see below example:
“Command”: “storeText”,
“Target”: “xpath=//*[@id="devices_BuilderId"]/div/div[3]/table/tbody/tr[${r}]/td[5]/span”,
“Value”: “vSerial”,
“Description”: “Store Serial Number”
},
It works sometimes but not all the time. Any suggestions would be wonderful.