Jump to content

Recommended Posts

Posted

Hi guys, i need a help.

I'm to do automation , i take ids of the webpage with inspect of google chrome .

But show errors  following  the pictures :

<div class="x-dock-panel x-layout-panel-hd-text x-dock-panel-title-text" id="ext-gen215" style="background-image: url(&quot;imgs/hemera/tree/icn_grupoa.png&quot;); background-repeat: no-repeat; background-position: 3px 50%; padding-left: 23px;">Grupo A</div>

 

Can Someone help me?
Please

 

Log1.png

tela.png

Posted

how you use _IEGetObjById()   ? - Show your code snippet.

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted (edited)

Folliwing my code:

#include <IE.au3>
#include <ScreenCapture.au3>
#include <File.au3>
#include <AutoItConstants.au3>


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

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

FAcessa()
FBusca()


;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,'admin')
   _IEFormElementSetValue($Email,'admin')
   _IEAction($Click,'Click')
   Sleep(3000)
EndFunc


Func FBusca()
   $GrupoA1 = _IEGetObjById($oIE,"ext-gen212")
   _IEAction($GrupoA1,'Click')
 
EndFunc

 

 

Edited by Melba23
Added code tags
  • Moderators
Posted

bluebug,

When you post code please use Code tags - see here how to do it.  Then you get a scrolling box and syntax colouring as you can see above now I have added the tags.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

  Reveal hidden contents

 

Posted
#include <IE.au3>
#include <ScreenCapture.au3>
#include <File.au3>
#include <AutoItConstants.au3>

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

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

FAcessa()
FBusca()
;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,'admin')
   _IEFormElementSetValue($Email,'admin')
   _IEAction($Click,'Click')
   Sleep(3000)
EndFunc


Func FBusca()
   $GrupoA1 = _IEGetObjById($oIE,"ex-gen212") 
   _IEAction($GrupoA1,'Click')
  
EndFunc

 

Sorry, i'm new in here.
I did not know.

  • Moderators
Posted

bluebug,

No problem.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

  Reveal hidden contents

 

Posted
  On 10/28/2016 at 7:32 PM, bluebug said:

$GrupoA1 = _IEGetObjById($oIE,"ex-gen212")

Expand  

"ex-gen212" ? 


I'm wondering if this "ext-gen212" element still exist after login, in the same document object.
Specifying: whether it is inside the frame ?

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted (edited)

First you should get Frame with _IEFrameGetObjByName()
Next you should use this Frame as Document:
 

$GrupoA1 = _IEGetObjById($oIEFrame,"ext-gen212")

 

EDIT:  btw. what value for src atribute is used in this frame ?
If this is document on different URL then you can not access this document (because of security reason).

 

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted (edited)
Local $oIEFrame = _IEGetObjByName($oIE, 'pg_inicial_iframe')
$GrupoA1 = _IEGetObjById($oIEFrame,"ext-gen212")

 

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

Ok , It worked brother! :lmao:

I Have a last question, for access the sub - elements i need to do like this?

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

Local $oLupa = _IEGetObjById($GrupoA1,"ext-gen116")
_IEAction($oLupa,"Click")

This is Correct?

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...