Looping input box with values in external file


#1

Hi Kantu !!

I created a macro as below,

{
“CreationDate”: “2018-9-15”,
“Commands”: [
{
“Command”: “store”,
“Target”: “fast”,
“Value”: “!replayspeed”
},
{
“Command”: “store”,
“Target”: “15”,
“Value”: “!TIMEOUT_WAIT”
},
{
“Command”: “store”,
“Target”: “60”,
“Value”: “!TIMEOUT_PAGELOAD”
},
{
“Command”: “open”,
“Target”: “http://www.tnpsc.gov.in/ResultGet-g2a2017rank.html”,
“Value”: “”
},
{
“Command”: “type”,
“Target”: “name=RN”,
“Value”: “260109293”
},
{
“Command”: “click”,
“Target”: “name=B1”,
“Value”: “”
},
{
“Command”: “storeText”,
“Target”: “//[@id=“table2”]/tbody/tr[2]/td[1]/b/font",
“Value”: “!csvLine”
},
{
“Command”: “storeText”,
“Target”: "//
[@id=“table2”]/tbody/tr[2]/td[3]/font/b”,
“Value”: “!csvLine”
},
{
“Command”: “storeText”,
“Target”: “//*[@id=“table2”]/tbody/tr[6]/td[2]/b”,
“Value”: “!csvLine”
},
{
“Command”: “csvSave”,
“Target”: “ibandata”,
“Value”: “”
}
]
}

This works fine but I need to loop this for about 1.2K values which I have in a external file.

Can you please help me here with a macro?/

//It may looks silly, but I am new to programming.

Thanks
Mohideen


#2

You can use the csvRead command for this.


#3

Thanks,

But how to loop it??


#4

Kantu has a LOOP button.

Or, a bit more complicated, you can loop inside a macro using While/endWhile as in this test macro: https://github.com/A9T9/Kantu/blob/master/testmacros/DemoCsvReadWithWhile.json (it is also installed with Kantu).