bluebug

Web

5 posts in this topic

Hi guys, good afternoon!

I  have a problem for to do an automation web page, thi is web page have dynamic id's.

Do can you help me?

 

#cs ----------------------------------------------------------------------------

 Author:Diego Lopes da Silva
 Version:1.0.0
 Script Function:
      1 - Acessar tela de relatorio de consummo
      2 - Gerar grafico de linha
      3 - Extrair dados para excel
      4 - Validar informações

#ce ----------------------------------------------------------------------------

;biblioteca paa abrir IE, Gerar Print de tela,capturar dados de txt
#include <IE.au3>
#include <ScreenCapture.au3>
#include <File.au3>
#include <AutoItConstants.au3>

;Variaveis para acesso ao sistema
Dim $link
Dim $login
Dim $senha

;Variaveis para função de print
Dim $eviden
Dim $nimg
Dim $opcao
Dim $oIE

;Variavel para data
Dim $datafat


Sleep(3000)
FAcessa()
FAcessaRelatorio()
;FExtraiRelatorio()
Sleep(3000)
;FGeraScriptCarga()
;ProcessClose("iexplore.exe")


;Criando Função de FAcessa
Func FAcessa()
  ;Lendo dados de configuração de acesso
   $file = "\\monaco\QualidadeSoftware\Automação\Configuração\RelatorioConsumo.conf"
   FileOpen($file, 0)

   For $i = 1 to _FileCountLines($file)
      $line = FileReadLine($file, $i)

   Next
   FileClose($file)

   ;Split para quebrar linha com a massa de dados
   $dados=StringSplit($line, "|")
   ;Setando variaveis de acesso
    $link=$dados[1]
    $login=$dados[2]
    $senha=$dados[3]
    $eviden=$dados[4]

   ;abrinfo navegador
    $oIE = ObjCreate("{D5E8041D-920F-45e9-B8FB-B1DEB82C6E5E}")
   _IENavigate($oIE, $link)
   $oIE.visible = 2
   WinSetState("", "",  @SW_MAXIMIZE);
   $Name = _IEGetObjById($oIE, "ext-comp-1001")
   $Email = _IEGetObjById($oIE, "ext-comp-1002")
   $Click = _IEGetObjById($oIE, "ext-gen43")

   _IEFormElementSetValue($Name,$login)
   _IEFormElementSetValue($Email,$senha)
   _IEAction($Click,'Click')
   Sleep(5000);
EndFunc


;função para acessar relatorio
Func FAcessaRelatorio()
     Local $oIEFrame = _IEGetObjByName($oIE, 'pg_inicial_iframe')
     $GrupoA1 = _IEGetObjById($oIEFrame,'ext-gen212')
     _IELoadWait($GrupoA1)
     _IEAction($GrupoA1,'Click')

     Local $oLupa = _IEGetObjById($oIEframe,'ext-gen115')
     _IELoadWait($oLupa)
     _IEAction($oLupa,'Click')



EndFunc

 

I need access id "ext-gen115" in attachment have code html and some prints.

print1.png

print2.png

index.htm

Share this post


Link to post
Share on other sites



This:

Local $oIEFrame = _IEGetObjByName($oIE, 'pg_inicial_iframe')
     $GrupoA1 = _IEGetObjById($oIEFrame,'ext-gen212')
     _IELoadWait($GrupoA1)
     _IEAction($GrupoA1,'Click')

Should be coded in this way:

Local $oIEFrame = _IEGetObjByName($oIE, 'pg_inicial_iframe')
     $GrupoA1 = _IEGetObjById($oIEFrame,'ext-gen212')
     _IEAction($GrupoA1,'Click')
     _IELoadWait($oIEFrame)

 

btw.

HTML snippet you posted as attachment do not contain "ext-gen115"


NEW:     ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button:

Spoiler

Last update: 2016-11-12
Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft Components * TeamViewer API -UDF * JavaManagement UDF * VIES over SOAPPOP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer UDF * WinSCP UDF *

My contribution to others projects: * _sql.au3 UDF  *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Best coding practices * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities *

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, The Art of Computer Programming
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

 

Share this post


Link to post
Share on other sites
<table border="0" cellpadding="0" cellspacing="0" class="x-btn-wrap x-btn " id="ext-gen115" style="width: auto;">
<tbody>
<tr>
    <td class="x-btn-left"><i>&nbsp;</i>
    </td>
    <td class="x-btn-center"><em unselectable="on">
    <button class="x-btn-text" type="button" id="ext-gen116">
    <img src="imgs/hemera/pesquisa_grupoA_old.png" alt="Pesquisar grupos, clientes e pontos de medição (antiga)">
</button>
</em>
</td>
    <td class="x-btn-right">
        <i>&nbsp;</i>
    </td>
</tr>
</tbody>
</table>

Sorry, ready ,  now thi is in post.

 

 

Share this post


Link to post
Share on other sites

did you try:
 

_IEImgClick($oIEFrame,"imgs/hemera/pesquisa_grupoA_old.png")

 

??

1 person likes this

NEW:     ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button:

Spoiler

Last update: 2016-11-12
Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft Components * TeamViewer API -UDF * JavaManagement UDF * VIES over SOAPPOP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer UDF * WinSCP UDF *

My contribution to others projects: * _sql.au3 UDF  *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Best coding practices * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities *

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, The Art of Computer Programming
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

 

Share this post


Link to post
Share on other sites

Yes, it worked.

Thanks, by help.

How to do for done is topic?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now