Hello and how is everyone doing?
I have a question about how to accomplish something (that isn’t clear to me from the demos and the documentation). I want to understand what order I need to put things, because the goal is to open the page, click some buttons, call the 1st line of the csv to fill certain fields, submit the form, then start a new form, but call the 2nd line of the csv file, and keep iterating. I’d like it to only go through 2 rows at first, to verify the proper functioning. I’m guessing that the “executescript_sandbox” needs to go into the subroutine but I’m not sure.
Here the order I have things now - it’s not correct obviously. Below this, I have the actual JSON, and below that I have the JSON of the subroutine.
read from the csv file
echo the status of that command
while_v2
echo the status of that command
run sub/Fillform
(this subroutine does the following:
echo Inside subroutine: Status = {!csvReadStatus}, Line =
{!csvReadLineNumber}
opens the webpage
clicks a few things
types a few things
calls the csv to type {!COL1}_{!csvReadLineNumber}
types something
calls the csv to type {!COL3}_{!csvReadLineNumber}
types a couple more things
clickAndWait to click the submit button
executeScript_Sandbox return Number(${!csvReadLineNumber})+1
store true ignore error
echo reading csv file
csvRead
store false
end
Based on the “DemoCSVREadWithWhile”, I tried the following (I’ve anonymized some of the entries so I can share here :
"Commands": [
{
"Command": "csvRead",
"Target": "mycsvfilenamehere.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": "run",
"Target": "sub/Fillform",
"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": "ReadCSVTestData.csv",
"Value": ""
},
{
"Command": "store",
"Target": "false",
"Value": "!errorIgnore"
},
{
"Command": "end",
"Target": "",
"Value": ""
}
]
}
SUBROUTINE
{
"Name": "Fillform",
"CreationDate": "2020-4-26",
"Commands": [
{
"Command": "comment",
"Target": "Subroutine for the reporter scripts",
"Value": ""
},
{
"Command": "echo",
"Target": "Inside subroutine: Status = ${!csvReadStatus}, Line = ${!csvReadLineNumber}",
"Value": "green"
},
{
"Command": "open",
"Target": "the URL goes here",
"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=type_of_issue_digital",
"Value": "Digital goods"
},
{
"Command": "type",
"Target": "id=fullname_input_text",
"Value": "my name goes here"
},
{
"Command": "type",
"Target": "id=email",
"Value": "jedevita@netflix.com"
},
{
"Command": "type",
"Target": "id=phone_number",
"Value": "000-000-0000"
},
{
"Command": "type",
"Target": "id=tm_holder_name",
"Value": "company name goes here"
},
{
"Command": "type",
"Target": "id=reported_username",
"Value": "${!COL1}_${!csvReadLineNumber}"
},
{
"Command": "type",
"Target": "id=description",
"Value": "description goes here"
},
{
"Command": "type",
"Target": "id=link_to_tweet",
"Value": "${!COL3}_${!csvReadLineNumber}"
},
{
"Command": "type",
"Target": "id=disclaimer_third_parties",
"Value": "disclaimer_third_parties"
},
{
"Command": "type",
"Target": "id=disclaimer_accuracy",
"Value": "disclaimer_accuracy"
},
{
"Command": "type",
"Target": "id=disclaimer_good_faith",
"Value": "disclaimer_good_faith"
},
{
"Command": "clickAndWait",
"Target": "id=submit_button",
"Value": ""
}
]
}