Error in executeScript code: Invalid or unexpected token, variable is not read

I have a CSV file which lists the identifiers that are checked by my macro in forEach loop. The identifier is stored in a variable (CCC). There is a DOM element on the page that has a class, and depending on its state, the value of the class changes. I need to check the value of an element’s DOM class at a particular time. I’m trying to access an HTML element via executeScript using its id, with part of the id to be read from a variable but I’m getting an error:

Error in executeScript code: Invalid or unexpected token

part of my code:

{
      "Command": "executeScript_Sandbox",
      "Target": "return Number (${uID})",
      "Value": "CCC",
      "Description": ""
    },
    {
      "Command": "executeScript",
      "Target": "var element = document.getElementById('ad-user-table-row-' + ${CCC} + ');\n var classes = element.className;\n return classes;",
      "Value": "checkClass",
      "Description": ""
    },
1 Like

Hi, it works for me:

Thank you for reply. But you are using executeScript_Sandbox .

I am using executeScript with JS code. As far as I know executeScript_Sandbox does not accept JS code.