Command.target.trim is not a function

Hi
Im new. eeek.
I have a problem with this command.
{
“Command”: “store”,
“Target”: “1”,
“Value”: “line2counter”
},
The log shows:

  • [info] Executing: | store | 1 | line2counter |
  • [error][ignored] command.target.trim is not a function

That command seem to work the first time its run but not the next time. This makes me think its some kind of scope issue…

I also have an issue around this variable as when I use it in a store text. Again it works the first pass/page for each line but not the second.
{
“Command”: “storeText”,
“Target”: “xpath=//*[@id=“content_0_contentcolumnmain_0_pnlResult”]/div/div[${line2counter}]/div[1]/h4”,
“Value”: “!csvLine”
}

I get a !statusOK == false. here is the log:

[info] Executing: | echo | line counter is {line2counter} | red | [echo] line counter is 1 [info]Executing: | storeText | xpath=//*[@id="content_0_contentcolumnmain_0_pnlResult"]/div/div[{line2counter}]/div[1]/h4 | !csvLine |
[info]Executing: | echo | ${!statusOK} - status | |
[echo] false - status

Any help gratefully received as I’m stuck. Obviously Im doing something stupid.
Cheers!

Can you post a test macro?

Hi Ulrich
thanks for looking into this :slight_smile:

{
“Name”: “tester_FillForm”,
“CreationDate”: “2019-6-29”,
“Commands”: [
{
“Command”: “store”,
“Target”: “MEDIUM”,
“Value”: “!replayspeed”
},
{
“Command”: “csvRead”,
“Target”: “search.csv”,
“Value”: “”
},
{
“Command”: “echo”,
“Target”: “Status = {!csvReadStatus}, line = {!csvReadLineNumber}”,
“Value”: “”
},
{
“Command”: “while_v2”,
“Target”: “{!csvReadStatus} == \"OK\"", "Value": "" }, { "Command": "echo", "Target": "status = {!csvReadStatus}, line = {!csvReadLineNumber}", "Value": "" }, { "Command": "open", "Target": "******/search.aspx", "Value": "" }, { "Command": "echo", "Target": "Inside subroutine: Status = {!csvReadStatus}, Line = {!csvReadLineNumber}", "Value": "green" }, { "Command": "type", "Target": "id=content_0_contentcolumnmain_0_txtFamilyName", "Value": "{!COL2}”
},
{
“Command”: “type”,
“Target”: “id=content_0_contentcolumnmain_0_txtGivenName”,
“Value”: “{!COL1}" }, { "Command": "clickAndWait", "Target": "id=content_0_contentcolumnmain_0_btnSearch", "Value": "" }, { "Command": "store", "Target": "1", "Value": "line2counter" }, { "Command": "label", "Target": "PAGE", "Value": "" }, { "Command": "store", "Target": "true", "Value": "!errorignore" }, { "Command": "echo", "Target": "line counter is {line2counter}”,
“Value”: “red”
},
{
“Command”: “storeText”,
“Target”: “xpath=//[@id=“content_0_contentcolumnmain_0_pnlResult”]/div/div[{line2counter}]/div[1]/h4", "Value": "!csvLine" }, { "Command": "echo", "Target": "{!statusOK} - status",
“Value”: “”
},
{
“Command”: “if_v2”,
“Target”: “{!statusOK} == true", "Value": "" }, { "Command": "storeText", "Target": "xpath=//*[@id=\"content_0_contentcolumnmain_0_pnlResult\"]/div/div[{line2counter}]/div[2]/div[1]/div[2]”,
“Value”: “!csvLine”
},
{
“Command”: “storeText”,
“Target”: "xpath=//
[@id=“content_0_contentcolumnmain_0_pnlResult”]/div/div[{line2counter}]/div[2]/div[2]/div[2]", "Value": "!csvLine" }, { "Command": "storeText", "Target": "xpath=//*[@id=\"content_0_contentcolumnmain_0_pnlResult\"]/div/div[{line2counter}]/div[2]/div[3]/div[2]”,
“Value”: “!csvLine”
},
{
“Command”: “csvSave”,
“Target”: “test.csv”,
“Value”: “”
},
{
“Command”: “storeEval”,
“Target”: “{line2counter}+1", "Value": "line2counter" }, { "Command": "gotoLabel", "Target": "PAGE", "Value": "" }, { "Command": "else", "Target": "", "Value": "" }, { "Command": "store", "Target": 1, "Value": "line2counter" }, { "Command": "end", "Target": "", "Value": "" }, { "Command": "executeScript_Sandbox", "Target": "return Number({!csvReadLineNumber})+1”,
“Value”: “!csvReadLineNumber”
},
{
“Command”: “store”,
“Target”: “true”,
“Value”: “!errorIgnore”
},
{
“Command”: “echo”,
“Target”: "Reading CSV line No. ${!csvReadLineNumber} ",
“Value”: “!errorIgnore”
},
{
“Command”: “csvRead”,
“Target”: “search.csv”,
“Value”: “”
},
{
“Command”: “store”,
“Target”: “false”,
“Value”: “!errorIgnore”
},
{
“Command”: “end”,
“Target”: “”,
“Value”: “”
}
]
}

Do you have the website URL so that I can run this macro? (the macro itself looks ok)