I have a code that goes to a website and must select a date range, however, the dates are shown in a calendar as below:
If you note the calendar shows the last 5 days of the previous month and because of that some days might appear twice in the calendar which causes iMacros to fail in selecting my date (28) correctly and just ignores my command. Other point is that i can't mannualy type the dates into the box i have to select it using this shitty calendar.
I use a CSV file to select my date ranges and input them and it works perfectly fine on the code, so i figured the problem is actully the display of the calendar in the website. Has anyone ever experienced such thing? Is there a way to dodge it? Thanks in advance.
Code: Select all
var macro;
macro = "CODE:";
macro += "VERSION BUILD=9030808 RECORDER=FX" + "\n";
macro += "SET !ERRORIGNORE YES" + "\n";
macro += "SET !TIMEOUT_PAGE 300" + "\n";
macro += "SET !DATASOURCE IRCICLO.csv" + "\n";
macro += "SET !DATASOURCE_COLUMNS 1" + "\n";
macro += "SET !DATASOURCE_COLUMNS 2" + "\n";
macro += "SET !DATASOURCE_COLUMNS 3" + "\n";
macro += "SET !DATASOURCE_COLUMNS 4" + "\n";
macro += "SET !DATASOURCE_COLUMNS 5" + "\n";
macro += "SET !LOOP 1" + "\n";
macro += "SET !DATASOURCE_LINE {{i}}" + "\n";
macro += "TAG POS=2 TYPE=A ATTR=HREF:javascript:acessarGera();" + "\n";
macro += "URL GOTO=http://sgi.e-boticario.com.br/Paginas/Acesso/Entrar.aspx?ReturnUrl=portal" + "\n";
macro += "TAG POS=1 TYPE=INPUT:TEXT FORM=ID:ctl00 ATTR=ID:txtUsuario_T2 CONTENT=jefersonm@grupoboticario.com.br" + "\n";
macro += "SET !ENCRYPTION NO " + "\n";
macro += "WAIT SECONDS=2" + "\n";
macro += "TAG POS=1 TYPE=INPUT:PASSWORD FORM=ID:ctl00 ATTR=ID:txtSenha_T2 CONTENT=bugalu12345!@#$" + "\n";
macro += "WAIT SECONDS=2" + "\n";
macro += "TAG POS=1 TYPE=A ATTR=ID:btnLogin_btn" + "\n";
macro += "WAIT SECONDS=2" + "\n";
macro += "TAG POS=1 TYPE=A ATTR=TXT:Adm.<SP>Vendas" + "\n";
macro += "WAIT SECONDS=2" + "\n";
macro += "TAG POS=1 TYPE=A ATTR=TXT:Intenção<SP>Revenda" + "\n";
macro += "WAIT SECONDS=2" + "\n";
macro += "TAG POS=1 TYPE=A ATTR=TXT:Consultar<SP>Intenções<SP>de<SP>Revenda" + "\n";
macro += "WAIT SECONDS=2" + "\n";
macro += "TAG POS=1 TYPE=IMG ATTR=ID:ContentPlaceHolder1_txtDataInicio_I2" + "\n"; - Here's where the calendar pops up
macro += "WAIT SECONDS=3" + "\n";
macro += "TAG POS=1 TYPE=IMG ATTR=ID:ContentPlaceHolder1_txtDataInicio_I" + "\n";
macro += "WAIT SECONDS=2" + "\n";
macro += "TAG POS=2 TYPE=DIV ATTR=TXT:janeiro,<SP>2017" + "\n"; - Just setting the first month of the year
macro += "WAIT SECONDS=3" + "\n";
macro += "TAG POS=1 TYPE=DIV ATTR=TXT:{{!COL3}}" + "\n"; - Here's where I input my date rage (start) COL3 is my source from a CSV file
macro += "WAIT SECONDS=3" + "\n";
macro += "TAG POS=1 TYPE=DIV ATTR=TXT:{{!COL2}}" + "\n"; Here's where I input my date rage (finish) COLS2 is my source from a CSV file
macro += "WAIT SECONDS=3" + "\n";
macro += "TAG POS=1 TYPE=INPUT:TEXT FORM=ID:form1 ATTR=ID:ContentPlaceHolder1_txtCodigoEstruturaComercial_T2 CONTENT={{!COL1}}" + "\n";
macro += "WAIT SECONDS=2" + "\n";
macro += "TAG POS=1 TYPE=SPAN ATTR=ID:ContentPlaceHolder1_ddlNivelEstruturaComercial_lblSelecionarDominio" + "\n";
macro += "WAIT SECONDS=2" + "\n";
macro += "TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:form1 ATTR=ID:ContentPlaceHolder1_ddlNivelEstruturaComercial_rptListaDominio_chkUsarValorDominio_3 CONTENT=YES" + "\n";
macro += "WAIT SECONDS=2" + "\n";
macro += "TAG POS=1 TYPE=SELECT FORM=ID:form1 ATTR=ID:ContentPlaceHolder1_ddlOrigem_d1 CONTENT=%7" + "\n";
macro += "WAIT SECONDS=2" + "\n";
macro += "TAG POS=1 TYPE=A ATTR=ID:ContentPlaceHolder1_btnBuscar_btn" + "\n";
macro += "WAIT SECONDS=15" + "\n";
macro += "TAG POS=1 TYPE=A ATTR=ID:ContentPlaceHolder1_btnExportar_btn" + "\n";
macro += "WAIT SECONDS=15" + "\n";
macro += "TAG POS=1 TYPE=A ATTR=TXT:Colunas<SP>a<SP>serem<SP>exportadas" + "\n";
macro += "WAIT SECONDS=2" + "\n";
macro += "TAG POS=1 TYPE=LABEL FORM=ID:form1 ATTR=TXT:Selecionar<SP>Todos" + "\n";
macro += "WAIT SECONDS=2" + "\n";
macro += "TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ID:form1 ATTR=ID:ckbSelecionarTodos CONTENT=YES" + "\n";
macro += "WAIT SECONDS=2" + "\n";
macro += "ONDOWNLOAD FOLDER=* FILE=Intencao_RevendaCICLO_{{!NOW:ddmmyyyy}}_{{!COL1}}.xls WAIT=YES" + "\n";
macro += "TAG POS=1 TYPE=A ATTR=ID:agendamentoExportacao_okButton_B1" + "\n";
macro += "TAG POS=1 TYPE=A ATTR=ID:popupOkButton" + "\n";
for (i=1;i<=10;i++){
iimSet("i",i)
iimPlay(macro);
}