This is my first post, but I often visit here when I need some help. Always I find the answer. Thanks for that.
But now i'm with some trouble here.. I'm not a developer and I'm in the first year of my college and just have a few classes of C#.
I'm having some problems here, and hope anybody can help. Down to business:
Every month I got to go to a site, do login with about 100 different logins to put some values that are found in a excel file. First I simplified the process with a macro that fill the needed informations so I just need to put the captcha.
Now I tried to make the macro to put the data to web, and it worked when I write the data into the macro.
Here is my macro:
Where I filled with "965000", I found this value in the Excel. I need the macro to extract this value and do it all alone.VERSION BUILD=7361445
TAB T=1
URL GOTO=https://www8.receita.fazenda.gov.br/Sim ... .aspx?id=5
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:frmPrincipal ATTR=ID:txtCNPJ CONTENT=07366228000117
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:frmPrincipal ATTR=ID:txtCPF CONTENT=12164155847
SET !ENCRYPTION NO
TAG POS=1 TYPE=INPUT:PASSWORD FORM=NAME:frmPrincipal ATTR=ID:txtCodAcesso CONTENT=011369666574
PAUSE
'CAPTCHA'
URL GOTO=https://www8.receita.fazenda.gov.br/Sim ... fault.aspx
SIZE X=1098 Y=673
DS CMD=CLICK X=251 Y=98 CONTENT=
'Inserir o periodo de apuração
DS CMD=KEY X=541 Y=199 CONTENT=06/2011
DS CMD=CLICK X=540 Y=234 CONTENT=
'inserir o cmd key valor da apuração
DS CMD=CLICK X=531 Y=195 CONTENT=
DS CMD=KEY X=531 Y=195 CONTENT=965000
DS CMD=CLICK X=538 Y=261 CONTENT=
DS CMD=CLICK X=589 Y=259 CONTENT=
'Determina quais as receitas. no caso, apenas serviço anexo III
DS CMD=CLICK X=92 Y=369 CONTENT=
DS CMD=CLICK X=107 Y=435 CONTENT=
DS CMD=CLICK X=601 Y=528 CONTENT=
'Valor do serviço anexo III
DS CMD=CLICK X=100 Y=311 CONTENT=
DS CMD=KEY X=100 Y=311 CONTENT=965000
DS CMD=CLICK X=597 Y=530 CONTENT=
DS CMD=CLICK X=670 Y=513 CONTENT=
ONDIALOG POS=1 BUTTON=YES
DS CMD=CLICK X=691 Y=511 CONTENT=
ONDIALOG POS=1 BUTTON=YES
The Excel CSV is like this:
110,AFR INDUSTRIA PLASTICA,"R$ 426,00",,,"R$ 426,00"
119,JR & MARTO ,"R$ 0,00"
127,ALTERNATIVA IMPRESSOES DIGITAIS[57],"R$ 74.774,74",,,,"R$ 74.774,74"
There will be one macro to each login. The first CSV column it's a unique code. So I need something like this (probably it's all completely wrong ;/) :
I need it desperately.VERSION BUILD=7361445
SET !DATASOURCE C:\Fechamento.csv
int line, cod;
line = 3;
do
{
cod = {{!COL1}}
line++
}
while (cod != 127)
line = line-1
SET !DATASOURCE_LINE {{line}} //it will check the code I manually put before, and use the column 3 of the line with the code.
TAB T=1
URL GOTO=https://www8.receita.fazenda.gov.br/Sim ... .aspx?id=5
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:frmPrincipal ATTR=ID:txtCNPJ CONTENT=07366228000117
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:frmPrincipal ATTR=ID:txtCPF CONTENT=12164155847
SET !ENCRYPTION NO
TAG POS=1 TYPE=INPUT:PASSWORD FORM=NAME:frmPrincipal ATTR=ID:txtCodAcesso CONTENT=011369666574
PAUSE
'CAPTCHA'
URL GOTO=https://www8.receita.fazenda.gov.br/Sim ... fault.aspx
SIZE X=1098 Y=673
DS CMD=CLICK X=251 Y=98 CONTENT=
'Inserir o periodo de apuração
DS CMD=KEY X=541 Y=199 CONTENT=06/2011
DS CMD=CLICK X=540 Y=234 CONTENT=
'inserir o cmd key valor da apuração
DS CMD=CLICK X=531 Y=195 CONTENT=
DS CMD=KEY X=531 Y=195 CONTENT={{!COL3}}
DS CMD=CLICK X=538 Y=261 CONTENT=
DS CMD=CLICK X=589 Y=259 CONTENT=
'Determina quais as receitas. no caso, apenas serviço anexo III
DS CMD=CLICK X=92 Y=369 CONTENT=
DS CMD=CLICK X=107 Y=435 CONTENT=
DS CMD=CLICK X=601 Y=528 CONTENT=
'Valor do serviço anexo III
DS CMD=CLICK X=100 Y=311 CONTENT=
DS CMD=KEY X=100 Y=311 CONTENT={{!COL3}}
DS CMD=CLICK X=597 Y=530 CONTENT=
DS CMD=CLICK X=670 Y=513 CONTENT=
ONDIALOG POS=1 BUTTON=YES
DS CMD=CLICK X=691 Y=511 CONTENT=
ONDIALOG POS=1 BUTTON=YES
Thank you guys!