Stored text to lower case help

Hello, i am using code to find one word from text in whole page:

{
“Command”: “storeText”,
“Target”: “xpath=//html”,
“Value”: “checklog”
},
{
“Command”: “if_v2”,
“Target”: “(${checklog}.includes (“word”) == true)”,
“Value”: “”
},
{
“Command”: “echo”,
“Target”: “found”,
“Value”: “”
},
{
“Command”: “end”,
“Target”: “”,
“Value”: “”
}

I need to make it case insensitive. I tried:
{
“Command”: “executeScript”,
“Target”: “${checklog}.toLowerCase()”,
“Value”: “checklog”
},
However it returns undefined.

You missed return in execute script try in this mode

{
  "Name": "LoverCase",
  "CreationDate": "2020-11-29",
  "Commands": [
    {
      "Command": "store",
      "Target": "AAA",
      "Value": "Var"
    },
    {
      "Command": "executeScript_Sandbox",
      "Target": "return ${Var}.toLowerCase()",
      "Value": "Var"
    }
  ]
}
1 Like