Thank you. That makes sense. I think the store command is making this more confusing. Instead I will import a csv with only 2 rows, to start with. So! Here is my remaining question:
I still don’t understand what these “echo” and “while_v2” and executeScript sandbox commands are for, and what order they need to appear in to achieve my goal or if they are even necessary.
The reason for my confusion is that the demo for
“demoCsvReadWithWhile” assumes a goal of filling a single form with several rows from the csv.
My goal is different: I want to fill a form with row 1 of csv, submit it, and then do another form that pulls row 2 and submits it, and so on.
I am hoping for your patience with my last question before I give up because there is no documentation for my goal. Can you suggest changes I must make to the macro and the sub routine? Many thanks, I appreciate your help.
Macro
{
“Name”: “Reporter”,
“CreationDate”: “2020-4-26”,
“Commands”: [
{
“Command”: “csvRead”,
“Target”: “5tweets.csv”,
“Value”: “”
},
{
“Command”: “echo”,
“Target”: “Status = ${!csvReadStatus}, line = ${!csvReadLineNumber}”,
“Value”: “”
},
{
“Command”: “while_v2”,
“Target”: “${!csvReadStatus} == "OK"”,
“Value”: “”
},
{
“Command”: “run”,
“Target”: “sub/Fillform”,
“Value”: “”
},
{
“Command”: “echo”,
“Target”: “Status = ${!csvReadStatus}, line = ${!csvReadLineNumber}”,
“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”: “run”,
“Target”: “sub/Fillform”,
“Value”: “”
},
{
“Command”: “csvRead”,
“Target”: “ReadCSVTestData.csv”,
“Value”: “”
},
{
“Command”: “store”,
“Target”: “false”,
“Value”: “!errorIgnore”
},
{
“Command”: “end”,
“Target”: “”,
“Value”: “”
}
]
}
SUBROUTINE HERE
{
“Name”: “Fillform”,
“CreationDate”: “2020-4-26”,
“Commands”: [
{
“Command”: “comment”,
“Target”: “Subroutine for the reporter script”,
“Value”: “”
},
{
“Command”: “comment”,
“Target”: “echo // Inside subroutine: Status = ${!csvReadStatus}, Line = ${!csvReadLineNumber}”,
“Value”: “green”
},
{
“Command”: “open”,
“Target”: “https://formURLhere.com”,
“Value”: “”
},
{
“Command”: “click”,
“Target”: “xpath=//*[@id="reporter_type"]/li[1]/div/label/span”,
“Value”: “”
},
{
“Command”: “click”,
“Target”: “id=type_of_issue_digital”,
“Value”: “”
},
{
“Command”: “type”,
“Target”: “id=fullname_input_text”,
“Value”: “myname”
},
{
“Command”: “type”,
“Target”: “id=email”,
“Value”: “me@myemail.com”
},
{
“Command”: “type”,
“Target”: “id=phone_number”,
“Value”: “3105551212”
},
{
“Command”: “type”,
“Target”: “id=tm_holder_name”,
“Value”: “companyname”
},
{
“Command”: “type”,
“Target”: “id=reported_username”,
“Value”: “${!COL1}${!csvReadLineNumber}"
},
{
“Command”: “type”,
“Target”: “id=description”,
“Value”: “Selling bad accounts”
},
{
“Command”: “type”,
“Target”: “id=link_to_tweet”,
“Value”: "${!COL3}${!csvReadLineNumber}”
},
{
“Command”: “click”,
“Target”: “id=disclaimer_third_parties”,
“Value”: “”
},
{
“Command”: “comment”,
“Target”: “type // id=disclaimer_third_parties”,
“Value”: “disclaimer_third_parties”
},
{
“Command”: “click”,
“Target”: “id=disclaimer_accuracy”,
“Value”: “”
},
{
“Command”: “comment”,
“Target”: “type // id=disclaimer_accuracy”,
“Value”: “disclaimer_accuracy”
},
{
“Command”: “click”,
“Target”: “id=disclaimer_good_faith”,
“Value”: “”
},
{
“Command”: “comment”,
“Target”: “type // id=disclaimer_good_faith”,
“Value”: “disclaimer_good_faith”
},
{
“Command”: “clickAndWait”,
“Target”: “id=submit_button”,
“Value”: “”
}
]
}