Storetext based on div class =

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:

Showing 1 - 2 of 2

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.

Just to clarify, you mean the xpath keeps changing?

I resolved this issue with this code:


{
      "Command": "storeText",
      "Target": "xpath=//*[@id=\"devicesHeader\"]/div[2]/div/span",
      "Value": "vDeviceCt",
      "Description": "store ex: Showing 1 - 2 of 2"
    },
    {
      "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": ""
    },
    {
      "Command": "if",
      "Target": "${vDeviceCt}==0",
      "Value": "then",
      "Description": "If device is not found then store \"Nothing was found\" and go to the next one."
    },
    {
      "Command": "storeText",
      "Target": "Nothing was found",
      "Value": "NotFound",
      "Description": "Asset not found"
    },
    {
      "Command": "gotoIf",
      "Target": "${vDeviceCt}==0",
      "Value": "NEXT",
      "Description": "Go to next asset this not found"
    },
    {
      "Command": "end",
      "Target": "",
      "Value": "",
      "Description": "End if"
    },
    {
      "Command": "store",
      "Target": "1",
      "Value": "r",
      "Description": "Review Table by row"
    },
    {
      "Command": "while",
      "Target": "(${r}<=${vDeviceCt})",
      "Value": "",
      "Description": "Do until r = vDeviceCt"
    },
    {
      "Command": "echo",
      "Target": "${r}",
      "Value": "",
      "Description": "Do until r = vDeviceCt"
    },
    {
      "Command": "storeText",
      "Target": "xpath=//*[@id=\"devices_BuilderId\"]/div[3]/table/tr[${r}]/td[5]/span",
      "Value": "vSerial",
      "Description": "Store Serial Number"
    },

Nice, thanks for the feedback.