aisingapore / TagUI

Free RPA tool by AI Singapore
Apache License 2.0
5.65k stars 585 forks source link

Help with DOM or XPath, how to point to a sibling of a web element - some examples #937

Closed marcelocecin closed 3 years ago

marcelocecin commented 3 years ago

hi Ken ! I need to click on the save icon according to a value, example: 350,90

can you please help me with this scenario ?

<table class="ne-tabela-expansivel tabTp1 w100percent clr">
<tbody style="vertical-align: top;" class=""><tr class="click "><td class="noClick w5" style="padding-left: 3px;"><input type="checkbox" name="_id38_0:_id42" value="true" class="frmCheck chkSel ml5 tabindex" tabindex="102"></td><td class="openOn  w19" title="Pressione ENTER para exibir o comprovante referente à linha 1. Utilize as setas para navegar"><span class="expansivel fl ml5 mr5 tabindex" tabindex="103">Abrir/Fechar</span><span class="fl">09/02/2021</span></td><td class="alignLeft w27" title="Pressione ENTER para exibir o comprovante referente à linha 1. Utilize as setas para navegar">468/88417-02                  </td><td class="alignLeft w27" title="Pressione ENTER para exibir o comprovante referente à linha 1. Utilize as setas para navegar">ZAPI DISTRIBUIDORA LTDA</td><td class="alignRight w11" title="Pressione ENTER para exibir o comprovante referente à linha 1. Utilize as setas para navegar"><span class="mr5 ">350,90</span></td><td class="noClick"><form class="seiButton" action="javascript;"><input type="button" onclick="javascript:processarSEILinhaReemissao(this, 'enviarEmail'); return false;" class="ico-email ico_1line_Tip tabindex bb0 bt0 bl0 br0" alt="" tabindex="104"></form><form class="seiButton" action="javascript;"><input type="button" onclick="javascript:processarSEILinhaReemissao(this, 'imprimir'); return false;" class="ico-imprimir ico_1line_Tip tabindex bb0 bt0 bl0 br0" alt="" tabindex="105"></form><form class="seiButton" action="javascript;"><input type="button" onclick="javascript:processarSEILinhaReemissao(this, 'salvarComo'); return false;" class="ico-salvar ico_1line_Tip tabindex bb0 bt0 bl0 br0" alt="" tabindex="106"></form></td></tr><tr class="expansive" style="display: table-row;"><td colspan="6" class="noPadding"><form action="/ibpjmultipagreemissao/comprovantePagtoBoleto.jsf" id="frmExpansivel"><input type="hidden" id="CTRL" name="CTRL" value="669221115517150360"><input type="hidden" id="cdSequencialModalidade" name="cdSequencialModalidade" value="4"><input type="hidden" id="cdIndicadorCnpjpFornc" name="cdIndicadorCnpjpFornc" value="N"><input type="hidden" id="cdProdutoServicoRelacionado" name="cdProdutoServicoRelacionado" value="465"><input type="hidden" id="dtConsulta" name="dtConsulta" value="0"><input type="hidden" id="cdAgendadosPagoNaoPago" name="cdAgendadosPagoNaoPago" value="1"><input type="hidden" id="dtVencimentoPagamento" name="dtVencimentoPagamento" value="09/02/2021"><input type="hidden" id="cdControlePagamento" name="cdControlePagamento" value="468/88417-02                  "><input type="hidden" id="nrSequenciaContratoNegocio" name="nrSequenciaContratoNegocio" value="370964"><input type="hidden" id="cdTipoContratoNegocio" name="cdTipoContratoNegocio" value="21"><input type="hidden" id="cdPessoaJuridicaContrato" name="cdPessoaJuridicaContrato" value="2269651"></form><div class="boxExp pl5 pr5 pb10 pt10" style="display: none;"><div class="boxComprovanteLote efetuado pt0">
<div id="divComprovantes">
<div class="border1"><table class="w100percent"><tbody><tr><td class="pt0 pb0"><table class="tabela_comprovante"><tbody><tr><td class="pt0 pb0"><ul id="_id15" style="width: auto;" class="cabecalho after mr0"><li id="_id16" class="logo transacao"><img src="https://www.ne13.bradesconetempresa.b.br/ibpj/imagens/geral/logo_comprovante.gif" alt="Bradesco Net Empresa"></li></ul><ul id="_id18" style="width: auto;" class="cabecalho after mr0"><li id="_id19" class="info"><h2>Comprovante de Pagamento</h2><p>Boleto de Cobrança</p><p>Nº de Controle: 669221115517150360 | Autenticação Bancária: 7944512567985932846287290</p></li><li id="_id37" class="fn clr"></li></ul></td></tr></tbody></table><div class="box_grayLine_bottom bb1preta"><div class="after mb5"><table border="0" class="HtmlPanelGridBradesco"><tbody><tr><td class="alignRight vAb w120 pb10 pt0">Empresa:</td><td class="wAuto vAb pl10 bold pb10 pt0"><span class="bold">NOME<span class="pl10">|</span><span class="pl10">CNPJ:</span><span class="pl5">000.000.000/0000-00</span></span></td></tr>
<tr><td class="alignRight vAb w120 pb10 pt0">Conta de Débito</td><td class="wAuto vAb pl10 bold pb10 pt0"><span class="bold">Agência:<span class="pl5">0555</span>-1<span class="pl10">|</span><span class="pl10">Conta:</span><span class="pl5">00555</span>-0</span></td></tr>
<tr><td class="alignRight vAb w120 pb10 pt0">Pagador:</td><td class="wAuto vAb pl10 bold pb10 pt0"><span class="bold">NOME<span class="pl10">|</span><span class="pl10">CPF:</span><span class="pl5">00.000.000-00</span></span></td></tr>
</tbody></table></div></div><div class="box_grayLine_bottom bb1preta"><div class="after mb5"><table border="0" class="HtmlPanelGridBradesco"><tbody><tr><td class="alignRight vAb w120 pb10 pt0">Beneficiário:</td><td class="vAb pl10 bold pb10 w225 pt0">ZAPI DISTRIBUIDORA LTDA</td><td class="alignRight vAb w120 pb10 pl10 pt0">CNPJ:</td><td class="vAb pl10 bold pb10 w225 pt0">71.222.889/0002-80</td></tr>
<tr><td class="alignRight vAb w120 pb10 pt0">Agência:</td><td class="vAb pl10 bold pb10 w225 pt0"><span class="HtmlPanelGroupBradesco"></span></td><td class="alignRight vAb w120 pb10 pl10 pt0">Conta:</td><td class="vAb pl10 bold pb10 w225 pt0"><span class="HtmlPanelGroupBradesco"></span></td></tr>
</tbody></table><table border="0" class="HtmlPanelGridBradesco"><tbody><tr><td class="alignRight vAb w120 pt0">Nº de identificação:</td><td class="wAuto vAb pl10 bold pt0">34191.09008 12907.203165 61612.100000 5 85260000035090</td></tr>
</tbody></table><table border="0" class="HtmlPanelGridBradesco"><tbody><tr><td class="alignRight vAb w120 pb10 pt0">Banco Destino:</td><td class="vAb pl10 bold pb10 w225 pt0"><span class="HtmlPanelGroupBradesco">341- ITAU UNIBANCO S.A.</span></td><td class="alignRight vAb w120 pb10 pl10 pt0">Data de <br> Vencimento:</td><td class="vAb pl10 bold pb10 w225 pt0">09/02/2021</td></tr>
<tr><td class="alignRight vAb w120 pb10 pt0">Número de <br> Pagamento:</td><td class="vAb pl10 bold pb10 w225 pt0">468/88417-02</td><td class="alignRight vAb w120 pb10 pl10 pt0">Data de <br> Pagamento:</td><td class="vAb pl10 bold pb10 w225 pt0">09/02/2021</td></tr>
<tr><td class="alignRight vAb w120 pb10 pt0">Nº documento:</td><td class="vAb pl10 bold pb10 w225 pt0"></td><td class="alignRight vAb w120 pb10 pl10 pt0">Data de <br> Documento:</td><td class="vAb pl10 bold pb10 w225 pt0"></td></tr>
<tr><td class="alignRight vAb w120 pb10 pt0">Carteira:</td><td class="vAb pl10 bold pb10 w225 pt0"></td><td class="alignRight vAb w120 pb10 pl10 pt0">Nosso Número:</td><td class="vAb pl10 bold pb10 w225 pt0"></td></tr>
<tr><td class="alignRight vAb w120 pb10 pt0">Tipo de <br> Documento:</td><td class="vAb pl10 bold pb10 w225 pt0">OUTROS</td><td class="alignRight vAb w120 pb10 pl10 pt0">Nº NF/ FAT/ DUP:</td><td class="vAb pl10 bold pb10 w225 pt0"></td></tr>
<tr><td class="alignRight vAb w120 pb10 pt0">(=) Valor do Documento:</td><td class="vAb pl10 bold pb10 w225 pt0">350,90</td><td class="alignRight vAb w120 pb10 pl10 pt0">(-) Desconto / Abatimento:</td><td class="vAb pl10 bold pb10 w225 pt0">0,00</td></tr>
<tr><td class="alignRight vAb w120 pb10 pt0">(-) Outras Deduções:</td><td class="vAb pl10 bold pb10 w225 pt0">0,00</td><td class="alignRight vAb w120 pb10 pl10 pt0">(+) Mora / Multa:</td><td class="vAb pl10 bold pb10 w225 pt0">0,00</td></tr>
<tr><td class="alignRight vAb w120 pb10 pt0">(+) Outros Acréscimos:</td><td class="vAb pl10 bold pb10 w225 pt0">0,00</td><td class="alignRight vAb w120 pb10 pl10 pt0">(=) Valor Cobrado:</td><td class="vAb pl10 bold pb10 w225 pt0">350,90</td></tr>
</tbody></table><table border="0" class="HtmlPanelGridBradesco"><tbody><tr><td class="alignRight vAb w120 pb10 pt0">Uso da Empresa:</td><td class="wAuto vAb pl10 bold pb10 pt0"></td></tr>
</tbody></table></div></div><table class="w100percent"><tbody><tr><td class="boxP20 p10 box_grayLine_bottom">A transação acima foi realizada no Multipag Bradesco.</td></tr></tbody></table></td></tr></tbody></table><div class="baseSac after" style="width: auto;"><div class="sac after"><ul id="_id133" class="sac after fn clr"><li id="_id134" class="sac">SAC - Serviço de Apoio ao Cliente</li><li id="_id136" class="alo">Alô Bradesco<span class="fone">0800 704 8383</span></li><li id="_id139" class="deficiente">Deficiente Auditivo ou de Fala<span class="fone">0800 722 0099</span></li><li id="_id142" class="mensagem pl5">Cancelamentos, Reclamações e Informações. Atendimento 24 horas, 7 dias por semana.</li><li id="_id144" class="fn clr"><!-- --></li></ul><ul id="_id146" class="ouvidoria"><li id="_id147" class="ouvidoria">Ouvidoria</li><li id="_id149" class="fone">0800 727 9933</li><li id="_id151" class="mensagem">Atendimento de segunda a sexta-feira, das 8h às 18h, exceto feriados.</li></ul><!-- --></div><div class="fale"><p>Demais telefones consulte o site<br>Fale Conosco</p></div><div class="after fn clr"><!-- --></div></div></div></div>
    <form target="modal_infra_estrutura" method="post" name="formularioSalvarEnviarImprimir_comprovante" id="formularioSalvarEnviarImprimir_comprovante"><input type="hidden" id="INFRA_SEI_CONTEUDO_" value="" disabled="disabled"><input type="hidden" id="INFRA_SEI_HASHCODE_" value="REIrRpJgJFZ8RpHfYhM2lFRFb1pY" disabled="disabled"><input type="hidden" name="CTRL" value="669221115517150360"></form>
</div><div class="pb30"><ul id="_id38_0:_id71" class="lstUtil pt10 pb10"><li id="_id38_0:_id72" class="tp1"><a class="btn_enviar_email tabindex" onclick="javascript:processarSEIReemissao(this, 'enviarEmail'); return false;" href="javascript:;" tabindex="107">Enviar por e-mail</a></li><li id="_id38_0:_id75" class="tp2"><a class="btn_imprimir tabindex" onclick="javascript:processarSEIReemissao(this, 'imprimir'); return false;" href="javascript:;" tabindex="108">Imprimir</a></li><li id="_id38_0:_id78" class="tp3"><a class="btn_salvar_arquivo tabindex" onclick="javascript:processarSEIReemissao(this, 'salvarComo'); return false;" href="javascript:;" tabindex="109">Salvar como arquivo</a></li><li id="_id38_0:_id81" class="tp4"></li></ul></div></div></td></tr></tbody>
<tbody style="vertical-align: top;"><tr class="click odd"><td class="noClick w5" style="padding-left: 3px;"><input type="checkbox" name="_id38_1:_id42" value="true" class="frmCheck chkSel ml5 tabindex" tabindex="110"></td><td class="openOn  w19" title="Pressione ENTER para exibir o comprovante referente à linha 2. Utilize as setas para navegar"><span class="expansivel fl ml5 mr5 tabindex" tabindex="111">Abrir/Fechar</span><span class="fl">09/02/2021</span></td><td class="alignLeft w27" title="Pressione ENTER para exibir o comprovante referente à linha 2. Utilize as setas para navegar">469/133588-02                 </td><td class="alignLeft w27" title="Pressione ENTER para exibir o comprovante referente à linha 2. Utilize as setas para navegar">ZAPI DISTRIBUIDORA LTDA</td><td class="alignRight w11" title="Pressione ENTER para exibir o comprovante referente à linha 2. Utilize as setas para navegar"><span class="mr5 ">443,90</span></td><td class="noClick"><form class="seiButton" action="javascript;"><input type="button" onclick="javascript:processarSEILinhaReemissao(this, 'enviarEmail'); return false;" class="ico-email ico_1line_Tip tabindex bb0 bt0 bl0 br0" alt="" tabindex="112"></form><form class="seiButton" action="javascript;"><input type="button" onclick="javascript:processarSEILinhaReemissao(this, 'imprimir'); return false;" class="ico-imprimir ico_1line_Tip tabindex bb0 bt0 bl0 br0" alt="" tabindex="113"></form><form class="seiButton" action="javascript;"><input type="button" onclick="javascript:processarSEILinhaReemissao(this, 'salvarComo'); return false;" class="ico-salvar ico_1line_Tip tabindex bb0 bt0 bl0 br0" alt="" tabindex="114"></form></td></tr><tr class="expansive" style="display: none;"><td colspan="6" class="noPadding"><form action="/ibpjmultipagreemissao/comprovantePagtoBoleto.jsf" id="frmExpansivel"><input type="hidden" id="CTRL" name="CTRL" value="669221115517150360"><input type="hidden" id="cdSequencialModalidade" name="cdSequencialModalidade" value="4"><input type="hidden" id="cdIndicadorCnpjpFornc" name="cdIndicadorCnpjpFornc" value="N"><input type="hidden" id="cdProdutoServicoRelacionado" name="cdProdutoServicoRelacionado" value="465"><input type="hidden" id="dtConsulta" name="dtConsulta" value="0"><input type="hidden" id="cdAgendadosPagoNaoPago" name="cdAgendadosPagoNaoPago" value="1"><input type="hidden" id="dtVencimentoPagamento" name="dtVencimentoPagamento" value="09/02/2021"><input type="hidden" id="cdControlePagamento" name="cdControlePagamento" value="469/133588-02                 "><input type="hidden" id="nrSequenciaContratoNegocio" name="nrSequenciaContratoNegocio" value="370964"><input type="hidden" id="cdTipoContratoNegocio" name="cdTipoContratoNegocio" value="21"><input type="hidden" id="cdPessoaJuridicaContrato" name="cdPessoaJuridicaContrato" value="2269651"></form><div class="boxExp pl5 pr5 pb10 pt10"><div class="boxComprovanteLote efetuado pt0"></div><div class="pb30"><ul id="_id38_1:_id71" class="lstUtil pt10 pb10"><li id="_id38_1:_id72" class="tp1"><a class="btn_enviar_email tabindex" onclick="javascript:processarSEIReemissao(this, 'enviarEmail'); return false;" href="javascript:;" tabindex="115">Enviar por e-mail</a></li><li id="_id38_1:_id75" class="tp2"><a class="btn_imprimir tabindex" onclick="javascript:processarSEIReemissao(this, 'imprimir'); return false;" href="javascript:;" tabindex="116">Imprimir</a></li><li id="_id38_1:_id78" class="tp3"><a class="btn_salvar_arquivo tabindex" onclick="javascript:processarSEIReemissao(this, 'salvarComo'); return false;" href="javascript:;" tabindex="117">Salvar como arquivo</a></li><li id="_id38_1:_id81" class="tp4"></li></ul></div></div></td></tr></tbody>
<tbody style="vertical-align: top;" class=""><tr class="click "><td class="noClick w5" style="padding-left: 3px;"><input type="checkbox" name="_id38_2:_id42" value="true" class="frmCheck chkSel ml5 tabindex" tabindex="118"></td><td class="openOn  w19" title="Pressione ENTER para exibir o comprovante referente à linha 3. Utilize as setas para navegar"><span class="expansivel fl ml5 mr5 tabindex" tabindex="119">Abrir/Fechar</span><span class="fl">09/02/2021</span></td><td class="alignLeft w27" title="Pressione ENTER para exibir o comprovante referente à linha 3. Utilize as setas para navegar">470/6332149055-02             </td><td class="alignLeft w27" title="Pressione ENTER para exibir o comprovante referente à linha 3. Utilize as setas para navegar">PORTO SEGURO CIA DE SEGUROS GERAIS</td><td class="alignRight w11" title="Pressione ENTER para exibir o comprovante referente à linha 3. Utilize as setas para navegar"><span class="mr5 ">309,06</span></td><td class="noClick"><form class="seiButton" action="javascript;"><input type="button" onclick="javascript:processarSEILinhaReemissao(this, 'enviarEmail'); return false;" class="ico-email ico_1line_Tip tabindex bb0 bt0 bl0 br0" alt="" tabindex="120"></form><form class="seiButton" action="javascript;"><input type="button" onclick="javascript:processarSEILinhaReemissao(this, 'imprimir'); return false;" class="ico-imprimir ico_1line_Tip tabindex bb0 bt0 bl0 br0" alt="" tabindex="121"></form><form class="seiButton" action="javascript;"><input type="button" onclick="javascript:processarSEILinhaReemissao(this, 'salvarComo'); return false;" class="ico-salvar ico_1line_Tip tabindex bb0 bt0 bl0 br0" alt="" tabindex="122"></form></td></tr><tr class="expansive" style="display: none;"><td colspan="6" class="noPadding"><form action="/ibpjmultipagreemissao/comprovantePagtoBoleto.jsf" id="frmExpansivel"><input type="hidden" id="CTRL" name="CTRL" value="669221115517150360"><input type="hidden" id="cdSequencialModalidade" name="cdSequencialModalidade" value="4"><input type="hidden" id="cdIndicadorCnpjpFornc" name="cdIndicadorCnpjpFornc" value="N"><input type="hidden" id="cdProdutoServicoRelacionado" name="cdProdutoServicoRelacionado" value="465"><input type="hidden" id="dtConsulta" name="dtConsulta" value="0"><input type="hidden" id="cdAgendadosPagoNaoPago" name="cdAgendadosPagoNaoPago" value="1"><input type="hidden" id="dtVencimentoPagamento" name="dtVencimentoPagamento" value="09/02/2021"><input type="hidden" id="cdControlePagamento" name="cdControlePagamento" value="470/6332149055-02             "><input type="hidden" id="nrSequenciaContratoNegocio" name="nrSequenciaContratoNegocio" value="370964"><input type="hidden" id="cdTipoContratoNegocio" name="cdTipoContratoNegocio" value="21"><input type="hidden" id="cdPessoaJuridicaContrato" name="cdPessoaJuridicaContrato" value="2269651"></form><div class="boxExp pl5 pr5 pb10 pt10" style="display: none;"><div class="boxComprovanteLote efetuado pt0">
<div id="divComprovantes">
<div class="border1"><table class="w100percent"><tbody><tr><td class="pt0 pb0"><table class="tabela_comprovante"><tbody><tr><td class="pt0 pb0"><ul id="_id15" style="width: auto;" class="cabecalho after mr0"><li id="_id16" class="logo transacao"><img src="https://www.ne13.bradesconetempresa.b.br/ibpj/imagens/geral/logo_comprovante.gif" alt="Bradesco Net Empresa"></li></ul><ul id="_id18" style="width: auto;" class="cabecalho after mr0"><li id="_id19" class="info"><h2>Comprovante de Pagamento</h2><p>Boleto de Cobrança</p><p>Nº de Controle: 669221115517150360 | Autenticação Bancária: 0918565225604525058723013</p></li><li id="_id37" class="fn clr"></li></ul></td></tr></tbody></table><div class="box_grayLine_bottom bb1preta"><div class="after mb5"><table border="0" class="HtmlPanelGridBradesco"><tbody><tr><td class="alignRight vAb w120 pb10 pt0">Empresa:</td><td class="wAuto vAb pl10 bold pb10 pt0"><span class="bold">NOME<span class="pl10">|</span><span class="pl10">CNPJ:</span><span class="pl5">000.000.000/0000-00</span></span></td></tr>
<tr><td class="alignRight vAb w120 pb10 pt0">Conta de Débito</td><td class="wAuto vAb pl10 bold pb10 pt0"><span class="bold">Agência:<span class="pl5">0555</span>-1<span class="pl10">|</span><span class="pl10">Conta:</span><span class="pl5">00555</span>-0</span></td></tr>
<tr><td class="alignRight vAb w120 pb10 pt0">Pagador:</td><td class="wAuto vAb pl10 bold pb10 pt0"><span class="bold">NOME<span class="pl10">|</span><span class="pl10">CPF:</span><span class="pl5">00.000.000-00</span></span></td></tr>
</tbody></table></div></div><div class="box_grayLine_bottom bb1preta"><div class="after mb5"><table border="0" class="HtmlPanelGridBradesco"><tbody><tr><td class="alignRight vAb w120 pb10 pt0">Beneficiário:</td><td class="vAb pl10 bold pb10 w225 pt0">PORTO SEGURO CIA DE SEGUROS GE</td><td class="alignRight vAb w120 pb10 pl10 pt0">CNPJ:</td><td class="vAb pl10 bold pb10 w225 pt0">61.198.164/0001-60</td></tr>
<tr><td class="alignRight vAb w120 pb10 pt0">Agência:</td><td class="vAb pl10 bold pb10 w225 pt0"><span class="HtmlPanelGroupBradesco">02374-4</span></td><td class="alignRight vAb w120 pb10 pl10 pt0">Conta:</td><td class="vAb pl10 bold pb10 w225 pt0"><span class="HtmlPanelGroupBradesco">62480-2</span></td></tr>
</tbody></table><table border="0" class="HtmlPanelGridBradesco"><tbody><tr><td class="alignRight vAb w120 pt0">Nº de identificação:</td><td class="wAuto vAb pl10 bold pt0">23792.37403 59607.100480 06006.248006 9 85260000030906</td></tr>
</tbody></table><table border="0" class="HtmlPanelGridBradesco"><tbody><tr><td class="alignRight vAb w120 pb10 pt0">Banco Destino:</td><td class="vAb pl10 bold pb10 w225 pt0"><span class="HtmlPanelGroupBradesco">237- BANCO BRADESCO S.A.</span></td><td class="alignRight vAb w120 pb10 pl10 pt0">Data de <br> Vencimento:</td><td class="vAb pl10 bold pb10 w225 pt0">09/02/2021</td></tr>
<tr><td class="alignRight vAb w120 pb10 pt0">Número de <br> Pagamento:</td><td class="vAb pl10 bold pb10 w225 pt0">470/6332149055-02</td><td class="alignRight vAb w120 pb10 pl10 pt0">Data de <br> Pagamento:</td><td class="vAb pl10 bold pb10 w225 pt0">09/02/2021</td></tr>
<tr><td class="alignRight vAb w120 pb10 pt0">Nº documento:</td><td class="vAb pl10 bold pb10 w225 pt0"></td><td class="alignRight vAb w120 pb10 pl10 pt0">Data de <br> Documento:</td><td class="vAb pl10 bold pb10 w225 pt0"></td></tr>
<tr><td class="alignRight vAb w120 pb10 pt0">Carteira:</td><td class="vAb pl10 bold pb10 w225 pt0">005</td><td class="alignRight vAb w120 pb10 pl10 pt0">Nosso Número:</td><td class="vAb pl10 bold pb10 w225 pt0">000000000960</td></tr>
<tr><td class="alignRight vAb w120 pb10 pt0">Tipo de <br> Documento:</td><td class="vAb pl10 bold pb10 w225 pt0">OUTROS</td><td class="alignRight vAb w120 pb10 pl10 pt0">Nº NF/ FAT/ DUP:</td><td class="vAb pl10 bold pb10 w225 pt0"></td></tr>
<tr><td class="alignRight vAb w120 pb10 pt0">(=) Valor do Documento:</td><td class="vAb pl10 bold pb10 w225 pt0">309,06</td><td class="alignRight vAb w120 pb10 pl10 pt0">(-) Desconto / Abatimento:</td><td class="vAb pl10 bold pb10 w225 pt0">0,00</td></tr>
<tr><td class="alignRight vAb w120 pb10 pt0">(-) Outras Deduções:</td><td class="vAb pl10 bold pb10 w225 pt0">0,00</td><td class="alignRight vAb w120 pb10 pl10 pt0">(+) Mora / Multa:</td><td class="vAb pl10 bold pb10 w225 pt0">0,00</td></tr>
<tr><td class="alignRight vAb w120 pb10 pt0">(+) Outros Acréscimos:</td><td class="vAb pl10 bold pb10 w225 pt0">0,00</td><td class="alignRight vAb w120 pb10 pl10 pt0">(=) Valor Cobrado:</td><td class="vAb pl10 bold pb10 w225 pt0">309,06</td></tr>
</tbody></table><table border="0" class="HtmlPanelGridBradesco"><tbody><tr><td class="alignRight vAb w120 pb10 pt0">Uso da Empresa:</td><td class="wAuto vAb pl10 bold pb10 pt0"></td></tr>
</tbody></table></div></div><table class="w100percent"><tbody><tr><td class="boxP20 p10 box_grayLine_bottom">A transação acima foi realizada no Multipag Bradesco.</td></tr></tbody></table></td></tr></tbody></table><div class="baseSac after" style="width: auto;"><div class="sac after"><ul id="_id133" class="sac after fn clr"><li id="_id134" class="sac">SAC - Serviço de Apoio ao Cliente</li><li id="_id136" class="alo">Alô Bradesco<span class="fone">0800 704 8383</span></li><li id="_id139" class="deficiente">Deficiente Auditivo ou de Fala<span class="fone">0800 722 0099</span></li><li id="_id142" class="mensagem pl5">Cancelamentos, Reclamações e Informações. Atendimento 24 horas, 7 dias por semana.</li><li id="_id144" class="fn clr"><!-- --></li></ul><ul id="_id146" class="ouvidoria"><li id="_id147" class="ouvidoria">Ouvidoria</li><li id="_id149" class="fone">0800 727 9933</li><li id="_id151" class="mensagem">Atendimento de segunda a sexta-feira, das 8h às 18h, exceto feriados.</li></ul><!-- --></div><div class="fale"><p>Demais telefones consulte o site<br>Fale Conosco</p></div><div class="after fn clr"><!-- --></div></div></div></div>
    <form target="modal_infra_estrutura" method="post" name="formularioSalvarEnviarImprimir_comprovante" id="formularioSalvarEnviarImprimir_comprovante"><input type="hidden" id="INFRA_SEI_CONTEUDO_" value="" disabled="disabled"><input type="hidden" id="INFRA_SEI_HASHCODE_" value="of741LOJjoYp9BDxq9Z6+jAo4t5Y" disabled="disabled"><input type="hidden" name="CTRL" value="669221115517150360"></form>
</div><div class="pb30"><ul id="_id38_2:_id71" class="lstUtil pt10 pb10"><li id="_id38_2:_id72" class="tp1"><a class="btn_enviar_email tabindex" onclick="javascript:processarSEIReemissao(this, 'enviarEmail'); return false;" href="javascript:;" tabindex="123">Enviar por e-mail</a></li><li id="_id38_2:_id75" class="tp2"><a class="btn_imprimir tabindex" onclick="javascript:processarSEIReemissao(this, 'imprimir'); return false;" href="javascript:;" tabindex="124">Imprimir</a></li><li id="_id38_2:_id78" class="tp3"><a class="btn_salvar_arquivo tabindex" onclick="javascript:processarSEIReemissao(this, 'salvarComo'); return false;" href="javascript:;" tabindex="125">Salvar como arquivo</a></li><li id="_id38_2:_id81" class="tp4"></li></ul></div></div></td></tr></tbody>
</table>

I believe that one of the ways would be to do a search using DOM querySelector and nextSibling or XPath following-sibling so I can click in this button

<form class="seiButton" action="javascript;"><input type="button" onclick="javascript:processarSEILinhaReemissao(this, 'salvarComo'); return false;" class="ico-salvar ico_1line_Tip tabindex bb0 bt0 bl0 br0" alt="" tabindex="106"></form>

thank you very much !

ruthtxh commented 3 years ago

Hello @marcelocecin

You may try the following depending on whether you want to:

  1. Iterate and loop through the table to click on all save buttons with corresponding matching value - assuming there could be multiple matches OR
  2. Only click on one button on entire page - assuming there is only one exact match
**Scenario 1**
for n from 1 to 3
    if (//*/table/tbody[`n`]/tr[1]/td[5]/span/text() == '350,90')
        click //*/table/tbody[`n`]/tr[1]/td[6]/form[3]/input

**Scenario 2**
click (//*[@class="mr5 " and text() = "350,90"]/../..//*[@class="noClick"]//input)[3]

You can also put a variable price in place of 350,90 -

click (//*[@class="mr5 " and text() = "`price`"]/../..//*[@class="noClick"]//input)[3]
marcelocecin commented 3 years ago

hello @ruthtxh, it worked perfectly thank you very much !

ruthtxh commented 3 years ago

Just noticed there's a small typo in my solution, for looping it should be

for n from 1 to 3

That's great! Happy to help ~~

kensoh commented 3 years ago

Thanks Ruth! I edited your solution to include the updated for loop. Your creating a html file to test is a great idea.

Hi Marcelo, adding on, while dom step allows using functions in the browser like querySelector, almost always there is no need to do that. Because TagUI has a smart algorithm to find the best match base on the element identifier you provide.

If you provide a very specific XPath or CSS selector, it'll work. If you provide something looser like the value of an id or name or text value or class or href etc it'll work too. Even if you provide something that is a partial match (eg the actual id is a longer string with some other text), it will work too. TagUI does the selection progressively to find the best match, from the most accurate element to something that matches loosely.

Thus, from a user perspective, give as specific as possible if you want to be sure what you are interacting on. Give as loose as possible (eg click email) to your level of comfort that works so that it is more readable. Lastly, you can make use of object repository if you want to hide these long strings away from the flow.

kensoh commented 3 years ago

Also, if you specify an image snapshot of an UI element, TagUI will use computer vision to find it on the screen. And if you use (x,y) coordinates that'll work too. So, there are multiple ways to the same outcome, for user to choose best for scenario.

kensoh commented 3 years ago

Adding on, video of how the XPath of that sibling save icon is found - https://www.youtube.com/watch?v=3xaP8rRzoVQ

marcelocecin commented 3 years ago

hello @ruthtxh and @kensoh in this case I first tried to use computer vision, however the price values were not being found more and more TAGUI surprises me with the possibilities of interacting with several complex scenarios in addition, your response time and level is surprisingly excellent! thank you so much again !

marcelocecin commented 3 years ago

hello @kensoh I'm trying to capture another link from another website I followed the directions in your video and managed to capture it by the safari inspector: //h4[contains(text(),'11/02/2021')]/a[contains(text(),'BOI')]/@href

however when I run on TAGUI the error occurs that I did not find the occurrence

kensoh commented 3 years ago

Hi Marcelo, the reason is the use of single quotes in XPath. I think this is not mentioned in the new documentation.

TagUI sends the search over to Chrome enclosed in single quotes. A single quote in the XPath will throw error from Chrome.

Using double quotes in below XPath works as expected -

show //h4[contains(text(),"11/02/2021")]/a[contains(text(),"BOI")]/@href

I've also updated the new documentation on this. Thanks for raising this!

marcelocecin commented 3 years ago

thank you ! @kensoh !

kensoh commented 3 years ago

Our pleasure! Your queries and feedback will help us improve this free RPA tool, and bring more benefits to other users :)

marcelocecin commented 3 years ago

Hello guys I am facing a new situation and a new question came up about this case in scenario 1, would it be possible to store in variable count how many occurrences of tbody are inside the table? so the loop would be automated according to this variable:

**Scenario 1**
for n from 1 to `count`
    if (//*/table/tbody[`n`]/tr[1]/td[5]/span/text() == '350,90')
        click //*/table/tbody[`n`]/tr[1]/td[6]/form[3]/input

thanks !

kensoh commented 3 years ago

Hi Marcelo! You can use the count() function, it returns how many matches there is base on an identifier you provide. For eg -

total_items = count('xpath to test')

kensoh commented 3 years ago

For example, if //*[@class="mr5 " returns 3 matches, then 3 will be assigned to total_items, which you can use in a loop.

kensoh commented 3 years ago

Adding on - besides full XPath, it can be relative XPath or CSS selector or various HTML attributes can be used to match.

marcelocecin commented 3 years ago

hello Ken, perfect ! thanks again !