Page 1 of 1

Login and loops.

Posted: Wed Aug 20, 2008 11:40 am
by dmann07
When you loop though a macro does it always have to start at the beginning?

I’ve got a macro searches company and returns a table, that I extract to cvs (SAVEAS TYPE=EXTRACT FOLDER=C:\Test FILE=test_080820_141507.csv). Then have a loop that loop that looks for another company and writes to the csv file.

Each time it starts from the beginning and logs in. Is there anyway to cut that out?

Thanks for all the help.

David


URL GOTO=https://xxx.com/
TAG POS=1 TYPE=A ATTR=ID:amenu8
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:Login ATTR=NAME:USER CONTENT=daivd
TAG POS=1 TYPE=INPUT:PASSWORD FORM=NAME:Login ATTR=NAME:PASSWORD CONTENT=
TAG POS=1 TYPE=INPUT:SUBMIT FORM=NAME:Login ATTR=VALUE:Login
TAG POS=1 TYPE=A ATTR=ID:amenu5
SET !DATASOURCE input.csv
SET !DATASOURCE_COLUMNS 1
SET !DATASOURCE_LINE {{!LOOP}}
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:SearchInpLoi01Form ATTR=NAME:company_code CONTENT={{!COL1}}
TAG POS=1 TYPE=INPUT:IMAGE FORM=NAME:SearchInpLoi01Form ATTR=VALUE:Search
TAG POS=7 TYPE=TABLE ATTR=TXT:* EXTRACT=TXT
'SAVEAS TYPE=EXTRACT FOLDER=C:\Test FILE=test_{{!NOW:yymmdd_hhmmss}}.csv
SAVEAS TYPE=EXTRACT FOLDER=C:\Test FILE=IsaSearch.csv

Re: Login and loops.

Posted: Wed Aug 20, 2008 8:36 pm
by mknoll1
If you use the Imacros browser you can cut out the login code, login manually and then tell the script to run. THat would be the fastest and easiest way to do it. Otherwise you are going to have to break it up into separate scripts and invoke the first one and then invoke the looping part. You can do this in a variety of ways programmatically.

Re: Login and loops.

Posted: Thu Aug 21, 2008 4:27 am
by dmann07
I’ve decided to go with he 2nd choice of setting up a Macro that will login and the create individual marco for each test I’d like to run.

Thanks :)

David