franbrinus

Error APPCRASH

15 posts in this topic

Hi,

I am new in the forum. I am Spanish, excuse me for my English and for write the error in Spanish.

 I have a script in AutoIt that works correctly but sometimes randomly giving an error and automatically exits because the application fails unexpectedly. I use IE.au3 and Excel.au3, I don't know if these librarys can give this error.

ERROR:

Firma con problemas:
  Nombre del evento de problema:    APPCRASH
  Nombre de la aplicación:    eContact.exe
  Versión de la aplicación:    0.0.0.0
  Marca de tiempo de la aplicación:    562617bd
  Nombre del módulo con errores:    OLEAUT32.dll
  Versión del módulo con errores:    6.1.7601.18640
  Marca de tiempo del módulo con errores:    5441c30c
  Código de excepción:    c0000005
  Desplazamiento de excepción:    0004d4ca
  Versión del sistema operativo:    6.1.7601.2.1.0.256.4
  Id. de configuración regional:    3082
  Información adicional 1:    0a9e
  Información adicional 2:    0a9e372d3b4ad19135b953a78882e789
  Información adicional 3:    0a9e
  Información adicional 4:    0a9e372d3b4ad19135b953a78882e789

Lea nuestra declaración de privacidad en línea:
  http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0c0a

Si la declaración de privacidad en línea no está disponible, lea la declaración de privacidad sin conexión:
  C:\Windows\system32\es-ES\erofflps.txt

 

Can you help me?

Share this post


Link to post
Share on other sites



Welcome to the forum.

Which one AutoIt version you are usinng ?

Can you post au3 script here ?

btw.

If you are using IE.au3

So try to read and use this:
    ie.au3 UDF with AutoIt v3.3.14.x  

 


February 26, 2017: New SciTE4AutoIt3 available with the updated SciTE v3.7.3 release
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: 2017-02-26
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.au3 UDF * TeamViewer.au3 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

Thank you for your answer.

The AutoIt version is v3.3.14.1

The problem is that the error crash the script and I can't manage the error...

I write my script but it is a bit long...

#include <GUIConstantsEx.au3>
#include <IE.au3>
#include <WindowsConstants.au3>
#include <Excel.au3>
#include <Array.au3>
#include <GUIConstants.au3>
#include <File.au3>

$oMyError = ObjEvent("AutoIt.Error","MyErrFunc")

$archivo = FileOpenDialog("Selecciona un archivo...", "C:\", "Excel (*.xlsx)|Excel (*.xls)|Excel (*.csv)", 1 + 2 )

if $archivo <> "" Then

    if StringRight($archivo, 5) <> ".xlsx" And StringRight($archivo, 4) <> ".xls" And StringRight($archivo, 4) <> ".csv" Then
        MsgBox($MB_SYSTEMMODAL, "Error", "Error al abrir o leer el archivo. Debe escoger un archivo válido ('.xlsx', '.xls', '.csv').")
        Exit(0)
     EndIf

Else

   MsgBox($MB_SYSTEMMODAL, "Error", "Error al abrir o leer el archivo. Debe escoger un archivo válido ('.xlsx', '.xls', '.csv').")
   Exit(0)

EndIf

;Abro un Excel (los falses es para que no sean visibles y se haga en segundo plano), lo leo (los Default es para que coja el texto de las celdas y para que coja
;todas las celdas del Excel) y el resultado lo muestro en una ventana (lo hace solo la función _ArrayDisplay)
Sleep(2000)
Local $oExcel = _Excel_Open(false)
Local $oWorkbook = _Excel_BookOpen($oExcel, $archivo, false, false)
If @error Then
    MsgBox($MB_SYSTEMMODAL, "Error", "Error al abrir o leer el archivo. Debe escoger un archivo válido ('.xlsx', '.xls', '.csv').")
    Exit(0)
EndIf
Local $sResult = _Excel_RangeRead($oWorkbook, Default, $oWorkbook.ActiveSheet.Usedrange.Columns("A:A"), 1)
If @error Then
    MsgBox($MB_SYSTEMMODAL, "Error", "Error al abrir o leer el archivo. Debe escoger un archivo válido ('.xlsx', '.xls', '.csv').")
    Exit(0)
EndIf

_Excel_BookClose($oWorkbook, False)
_Excel_Close($oExcel, Default, True)

Opt("GUIOnEventMode", 1)

GUICreate("Robot eContact", 270, 90, Default, Default)
Local $idProgressbar1 = GUICtrlCreateProgress(10, 10, 250, 20)
GUICtrlSetColor(-1, 32250); not working with Windows XP Style
Local $idLabel = GUICtrlCreateLabel("0% - Empezando...", 10, 40, 250, 40)
GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEButton")
GUISetState(@SW_SHOW)

;ProgressOn("Progreso", "", "Ejecutando...", Default, Default, 2 + 16)
$saltoBarraProgreso = 100/(UBound($sResult)-1)

Global $oExcelResult = _Excel_Open(false)
Global $oWorkbookResult = _Excel_BookNew($oExcelResult)
_Excel_RangeWrite($oWorkbookResult, $oWorkbookResult.Activesheet, "NumRequerimiento", "A1")
_Excel_RangeWrite($oWorkbookResult, $oWorkbookResult.Activesheet, "Estado", "B1")
_Excel_RangeWrite($oWorkbookResult, $oWorkbookResult.Activesheet, "FechaEstado", "C1")
_Excel_RangeWrite($oWorkbookResult, $oWorkbookResult.Activesheet, "PendienteDe", "D1")
$oExcelResult.ActiveSheet.Range("A1:D1").Font.Bold = True
$oExcelResult.ActiveSheet.Range("A1:D1").Interior.ColorIndex = 15
$oExcelResult.ActiveSheet.Range("A1:D1").Borders.LineStyle = 1
_Excel_BookSaveAs($oWorkbookResult, @ScriptDir & "\PeticionesActualizadas.xlsx", Default, True)

For $i = 1 To UBound($sResult)-1 Step 1

   GUICtrlSetData($idProgressbar1, ($i-1)*$saltoBarraProgreso)
   GUICtrlSetData($idLabel, StringFormat("%i",($i-1)*$saltoBarraProgreso) & "% - Comprobando Solicitud " & $sResult[$i])
   ;ProgressSet(($i-1)*$saltoBarraProgreso, StringFormat("%i",($i-1)*$saltoBarraProgreso) & "% - Comprobando Solicitud " & $sResult[$i])
   Local $ret = compruebaEstadoSolicitud($sResult[$i], $i+1)
   if $ret <> "" Then
      _FileWriteLog(@ScriptDir & "\Log_eContact.log", $ret)
      _FileWriteLog(@ScriptDir & "\Log_eContact.log", $sResult[$i] & " ERROR PRIMER INTENTO")
      $ret = compruebaEstadoSolicitud($sResult[$i], $i+1)
      if $ret <> "" Then
         _Excel_RangeWrite($oWorkbookResult, $oWorkbookResult.Activesheet, $sResult[$i], "A" & $i+1)
         _Excel_RangeWrite($oWorkbookResult, $oWorkbookResult.Activesheet, "Error", "B" & $i+1)
         _Excel_RangeWrite($oWorkbookResult, $oWorkbookResult.Activesheet, "Error", "C" & $i+1)
         _Excel_RangeWrite($oWorkbookResult, $oWorkbookResult.Activesheet, "Error", "D" & $i+1)
         _Excel_BookSave($oWorkbookResult)
         _FileWriteLog(@ScriptDir & "\Log_eContact.log", $ret)
         _FileWriteLog(@ScriptDir & "\Log_eContact.log", $sResult[$i] & " ERROR SEGUNDO INTENTO")
      Else
         _FileWriteLog(@ScriptDir & "\Log_eContact.log", $sResult[$i] & " CORRECTO SEGUNDO INTENTO")
      EndIf
   Else
      _FileWriteLog(@ScriptDir & "\Log_eContact.log", $sResult[$i] & " CORRECTO PRIMER INTENTO")
   EndIf

Next

GUICtrlSetData($idProgressbar1, 100)
GUICtrlSetData($idLabel, "100% - Terminado")
;ProgressSet(100, "Terminado!")
Sleep(750)
;ProgressOff()

MsgBox($MB_SYSTEMMODAL, "Finalizado", "El proceso ha finalizado. Los resultados se encuentra en el archivo PeticionesActualizadas.xlsx.")

_Excel_BookClose($oWorkbookResult, False)
_Excel_Close($oExcelResult, Default, True)

Exit(0)

Func compruebaEstadoSolicitud($numeroPeticion, $pos)
   ConsoleWrite($numeroPeticion & @CRLF)

   Global $oIE = _IECreate("CONFIDENCIAL SITE WEB",0,0,1,0)
   While @error
      $oIE = _IECreate("CONFIDENCIAL SITE WEB",0,0,1,0)
   WEnd

   Sleep(3000)
   _IELoadWait($oIE)
   if @error Then
      _IEQuit($oIE)
      Return "Error: No se puede esperar a IE."
   EndIf

   Local $bBuzon = _IEGetObjById($oIE, "L2N1")
   _IEAction($bBuzon, "click")
   if @error Then
      _IEQuit($oIE)
      Return "Error: No se encuentra el enlace a 'Mis Solicitudes'."
   EndIf

   Sleep(5000)

   Local $oFrameA = _IEFrameGetObjByName($oIE, "contentAreaFrame")
   if @error Then
      _IEQuit($oIE)
      Return "Error: La página no ha cargado correctamente. Frame: 'contentAreaFrame'."
   EndIf

   Local $oFrameB = _IEFrameGetObjByName($oFrameA, "isolatedWorkArea")
   if @error Then
      _IEQuit($oIE)
      Return "Error: La página no ha cargado correctamente. Frame: 'isolatedWorkArea'."
   EndIf

   $contadorMS = 0
   While compruebaMisSolicitudes($oFrameB) == "Error" And $contadorMS < 4
      Local $oFrameB = _IEFrameGetObjByName($oFrameA, "isolatedWorkArea")
      if @error Then
         _IEQuit($oIE)
         Return "Error: La página no ha cargado correctamente. Frame: 'isolatedWorkArea'."
      EndIf
      $contadorMS = $contadorMS + 1
   WEnd

   Local $oLinks = _IELinkGetCollection($oFrameB)
   if @error Then
      _IEQuit($oIE)
      Return "Error: La página no ha cargado correctamente. 'GetLinks'."
   EndIf


   Local $auxLink

   For $oLink In $oLinks
    If StringInStr($oLink.id, "Clearbtn") <> 0 Then
        $auxLink = $oLink
        ExitLoop
    EndIf
   Next

   _IEAction($auxLink, "click")
   if @error Then
      _IEQuit($oIE)
      Return "Error: No se encuentra el botón de 'Reiniciar' el formulario de búsqueda."
   EndIf

   funcionEspera($oFrameB)

   Local $oInputs = _IETagNameGetCollection($oFrameB, "input")
   Local $auxInput

   For $oInput In $oInputs
    If StringInStr($oInput.name,"search_parameters[2].VALUE1") <> 0 Then
        $auxInput = $oInput
        ExitLoop
    EndIf
   Next

   _IEFormElementSetValue($auxInput, $numeroPeticion)

   For $oLink In $oLinks
    If StringInStr($oLink.id, "Searchbtn") <> 0 Then
        $auxLink = $oLink
        ExitLoop
    EndIf
   Next

   _IEAction($auxLink, "click")
   if @error Then
      _IEQuit($oIE)
      Return "Error: No se encuentra el botón de 'Buscar'."
   EndIf

   funcionEspera($oFrameB)

   $oLinks = _IELinkGetCollection($oFrameB)
   $auxLink = Null

   For $oLink In $oLinks
   If StringInStr($oLink.id, "result_table[1].description") <> 0 Then
     $auxLink = $oLink
     ExitLoop
   EndIf
   Next

   _IEAction($auxLink, "click")
   if @error Then
      _IEQuit($oIE)
      Return "Error: No se encuentra el enlace de la solicitud " & $numeroPeticion & " en los resultados."
   EndIf

   funcionEspera($oFrameB)

   $oFrameA = _IEFrameGetObjByName($oIE, "contentAreaFrame")
   if @error Then
      _IEQuit($oIE)
      Return "Error: La página no ha cargado correctamente. Frame: 'contentAreaFrame'."
   EndIf

   $oFrameB = _IEFrameGetObjByName($oFrameA, "isolatedWorkArea")
   if @error Then
      _IEQuit($oIE)
      Return "Error: La página no ha cargado correctamente. Frame: 'isolatedWorkArea'."
   EndIf

   $oLinks = _IELinkGetCollection($oFrameB)
   if @error Then
      _IEQuit($oIE)
      Return "Error: La página no ha cargado correctamente. 'GetLinks'."
   EndIf

   For $oLink In $oLinks
   If StringInStr($oLink.title, "Log de proceso") <> 0 Then
     $auxLink = $oLink
     ExitLoop
   EndIf
   Next

   if StringInStr($auxLink.title, "Suprimir") == 0 Then
      _IEAction($auxLink, "click")
   EndIf


   funcionEspera($oFrameB)

   Local $oTds = _IETagNameGetCollection($oFrameB, "span")
   Local $nuevoEstado
   Local $fechaEstado

   For $oTd In $oTds

      If $oTd.innerText == "Historial de status" Then
           Local $idTd = StringReplace($oTd.id, "LOG_TYPE", "F_NEW")
           Local $span = _IEGetObjById($oFrameB, $idTd)
           $nuevoEstado = $span.innerText
           $idTd = StringReplace($oTd.id, "LOG_TYPE", "UDATE")
           $span = _IEGetObjById($oFrameB, $idTd)
           $fechaEstado = $span.innerText
           ExitLoop
        EndIf

    Next

    ConsoleWrite("Estado: " & $nuevoEstado & @CRLF)
    ConsoleWrite("Fecha: " & $fechaEstado & @CRLF)

    For $oLink In $oLinks
   If StringInStr($oLink.title, "Personas/Organizaciones implicadas") <> 0 Then
     $auxLink = $oLink
     ExitLoop
   EndIf
   Next

   if StringInStr($auxLink.title, "Suprimir") == 0 Then
      _IEAction($auxLink, "click")
   EndIf

   funcionEspera($oFrameB)

   $oLinks = _IELinkGetCollection($oFrameB)
   $auxLink = Null

   For $oLink In $oLinks
      If StringInStr($oLink.id, "Table_pag_exp") <> 0 Then
        $auxLink = $oLink
        ExitLoop
      EndIf
   Next

   if $auxLink <> Null Then
      _IEAction($auxLink, "click")
      funcionEspera($oFrameB)
   EndIf

   Local $oTds = _IETagNameGetCollection($oFrameB, "span")
   Local $nuevoEstado
   Local $fechaEstado

   For $oTd In $oTds

      If $oTd.innerText == "Pendiente de" Then
           Local $idTd = StringReplace($oTd.id, "partn_fct_descr", "partner_no_descr")
           Local $pendiente = _IEGetObjById($oFrameB, $idTd)
           $pendiente = $pendiente.innerText
           ExitLoop
        EndIf

    Next

    ConsoleWrite("Pendiente de: " & $pendiente & @CRLF)

   _IEQuit($oIE)

   _Excel_RangeWrite($oWorkbookResult, $oWorkbookResult.Activesheet, $numeroPeticion, "A" & $pos)
   _Excel_RangeWrite($oWorkbookResult, $oWorkbookResult.Activesheet, $nuevoEstado, "B" & $pos)
   _Excel_RangeWrite($oWorkbookResult, $oWorkbookResult.Activesheet, $fechaEstado, "C" & $pos)
   _Excel_RangeWrite($oWorkbookResult, $oWorkbookResult.Activesheet, $pendiente, "D" & $pos)
   _Excel_BookSave($oWorkbookResult)

   Sleep(5000)

   Return ""

EndFunc


Func funcionEspera($oFrameB)

   Sleep(1000)
   While 1

      Local $espera = _IEGetObjById($oFrameB, "submitInProgress")
      if StringInStr($espera.outerhtml, "DISPLAY: block;") == 0 Then
         ExitLoop
      EndIf

   WEnd
   Sleep(1000)

EndFunc

Func compruebaMisSolicitudes($oFrameB)

   While 1

      Local $espera = _IEGetObjById($oFrameB, "bcTitle")
      if @error Then
         Sleep(500)
         return "Error"
      EndIf

      Sleep(500)
      return ""
   WEnd

EndFunc

Func MyErrFunc($oError)
   $seguirConObj=False
    ConsoleWrite("err.number is: " & @TAB & $oError.number & @CRLF & _
            "err.windescription:" & @TAB & $oError.windescription & @CRLF & _
            "err.description is: " & @TAB & $oError.description & @CRLF & _
            "err.source is: " & @TAB & $oError.source & @CRLF & _
            "err.helpfile is: " & @TAB & $oError.helpfile & @CRLF & _
            "err.helpcontext is: " & @TAB & $oError.helpcontext & @CRLF & _
            "err.lastdllerror is: " & @TAB & $oError.lastdllerror & @CRLF & _
            "err.scriptline is: " & @TAB & $oError.scriptline & @CRLF & _
            "err.retcode is: " & @TAB & $oError.retcode & @CRLF & @CRLF)

   _FileWriteLog(@ScriptDir & "\Log_eContact.log", " err.number is: " & $oError.number)
EndFunc   ;==>_ErrFunc

Func CLOSEButton()

   _Excel_BookClose($oWorkbookResult, False)
   _Excel_Close($oExcelResult, Default, True)
   _IEQuit($oIE)

    MsgBox($MB_OK, "Saliendo...", "Has seleccionado salir. Saliendo...")
    Exit(0)

EndFunc   ;==>CLOSEButton

 

Share this post


Link to post
Share on other sites

I think that the error is en IE.au3 when I use the function _IEFrameGetObjByName but I don't understand why this error is only sometimes randomly.

Share this post


Link to post
Share on other sites

I think that the error is en IE.au3 when I use the function _IEFrameGetObjByName but I don't understand why this error is only sometimes randomly.

Which Windows Version you are using ?
Is it 64 Bit ? If yes try to compile with Aut2exe_x64.exe

 

 


February 26, 2017: New SciTE4AutoIt3 available with the updated SciTE v3.7.3 release
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: 2017-02-26
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.au3 UDF * TeamViewer.au3 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

My Windows Version is 32 bits. I compile from Scite with Compile option. I don't know if this can be the reason. I go to try compile with Auto2exe whitout mark x64 option.

Share this post


Link to post
Share on other sites

I have tried compile with Auto2exe without mark x64 option but it give the same error randomly. 

Have you any idea of the problem??

Thank you for your help!!!

Share this post


Link to post
Share on other sites

can you isolate which one:

_IEFrameGetObjByName

fires this issue ?

 


February 26, 2017: New SciTE4AutoIt3 available with the updated SciTE v3.7.3 release
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: 2017-02-26
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.au3 UDF * TeamViewer.au3 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

#9 ·  Posted (edited)

I have modified the function compruebaEstadoPeticion for to isolate _IEFrameGetObjByName and it is now: 

Func compruebaEstadoSolicitud($numeroPeticion, $pos)
   ConsoleWrite($numeroPeticion & @CRLF)

   Global $oIE = _IECreate("CONFIDENTIAL SITE WEB",0,0,1,0)
   While @error
      $oIE = _IECreate("CONFIDENTIAL SITE WEB",0,0,1,0)
   WEnd

   Sleep(3000)
   _IELoadWait($oIE)
   if @error Then
      _IEQuit($oIE)
      Return "Error: No se puede esperar a IE."
   EndIf

   Local $bBuzon = _IEGetObjById($oIE, "L2N1")
   _IEAction($bBuzon, "click")
   if @error Then
      _IEQuit($oIE)
      Return "Error: No se encuentra el enlace a 'Mis Solicitudes'."
   EndIf

   Sleep(5000)

   Local $oFrameA = _IEFrameGetObjByName($oIE, "contentAreaFrame")
   if @error Then
      _IEQuit($oIE)
      Return "Error: La página no ha cargado correctamente. Frame: 'contentAreaFrame'."
   EndIf

   Local $oFrameB = _IEFrameGetObjByName($oFrameA, "isolatedWorkArea")
   if @error Then
      _IEQuit($oIE)
      Return "Error: La página no ha cargado correctamente. Frame: 'isolatedWorkArea'."
   EndIf

   $contadorMS = 0
   While compruebaMisSolicitudes($oFrameB) == "Error" And $contadorMS < 4
      Local $oFrameB = _IEFrameGetObjByName($oFrameA, "isolatedWorkArea")
      if @error Then
         _IEQuit($oIE)
         Return "Error: La página no ha cargado correctamente. Frame: 'isolatedWorkArea'."
      EndIf
      $contadorMS = $contadorMS + 1
   WEnd

   _IEQuit($oIE)

   Sleep(5000)

   Return ""

EndFunc

I have execute the script 4 times and it hasn't given error. I am going crazy with this error!! Any idea more??

Thank you very much.

Edited by franbrinus

Share this post


Link to post
Share on other sites

Hi,

I have tried changing the function compruebaEstadoPeticion to this code:

Func compruebaEstadoSolicitud($numeroPeticion, $pos)
   ConsoleWrite($numeroPeticion & @CRLF)

   Global $oIE = _IECreate("https://econtact-ict.enelint.global/",0,0,1,0)
   While @error
      $oIE = _IECreate("https://econtact-ict.enelint.global/",0,0,1,0)
   WEnd

   Sleep(3000)
   _IELoadWait($oIE)
   if @error Then
      _IEQuit($oIE)
      Return "Error: No se puede esperar a IE."
   EndIf

   Local $bBuzon = _IEGetObjById($oIE, "L2N1")
   _IEAction($bBuzon, "click")
   if @error Then
      _IEQuit($oIE)
      Return "Error: No se encuentra el enlace a 'Mis Solicitudes'."
   EndIf

   Sleep(5000)
   _FileWriteLog(@ScriptDir & "\Log_eContact.log", "1")
   Local $oFrameA = _IEFrameGetObjByName($oIE, "contentAreaFrame")
   if @error Then
      _IEQuit($oIE)
      Return "Error: La página no ha cargado correctamente. Frame: 'contentAreaFrame'."
   EndIf
_FileWriteLog(@ScriptDir & "\Log_eContact.log", "2")
   Local $oFrameB = _IEFrameGetObjByName($oFrameA, "isolatedWorkArea")
   if @error Then
      _IEQuit($oIE)
      Return "Error: La página no ha cargado correctamente. Frame: 'isolatedWorkArea'."
   EndIf

   $contadorMS = 0
   While compruebaMisSolicitudes($oFrameB) == "Error" And $contadorMS < 4
      _FileWriteLog(@ScriptDir & "\Log_eContact.log", "3")
      Local $oFrameB = _IEFrameGetObjByName($oFrameA, "isolatedWorkArea")
      if @error Then
         _IEQuit($oIE)
         Return "Error: La página no ha cargado correctamente. Frame: 'isolatedWorkArea'."
      EndIf
      $contadorMS = $contadorMS + 1
   WEnd

    Local $oLinks = _IELinkGetCollection($oFrameB)
   if @error Then
      _IEQuit($oIE)
      Return "Error: La página no ha cargado correctamente. 'GetLinks'."
   EndIf


   Local $auxLink
_FileWriteLog(@ScriptDir & "\Log_eContact.log", "4")
   For $oLink In $oLinks
    If StringInStr($oLink.id, "Clearbtn") <> 0 Then
        $auxLink = $oLink
        ExitLoop
    EndIf
   Next
_FileWriteLog(@ScriptDir & "\Log_eContact.log", "5")
   _IEAction($auxLink, "click")
   if @error Then
      _IEQuit($oIE)
      Return "Error: No se encuentra el botón de 'Reiniciar' el formulario de búsqueda."
   EndIf

   funcionEspera($oFrameB)
_FileWriteLog(@ScriptDir & "\Log_eContact.log", "6")
   Local $oInputs = _IETagNameGetCollection($oFrameB, "input")
   Local $auxInput

   For $oInput In $oInputs
    If StringInStr($oInput.name,"search_parameters[2].VALUE1") <> 0 Then
        $auxInput = $oInput
        ExitLoop
    EndIf
   Next
_FileWriteLog(@ScriptDir & "\Log_eContact.log", "7")
   _IEFormElementSetValue($auxInput, $numeroPeticion)

   For $oLink In $oLinks
    If StringInStr($oLink.id, "Searchbtn") <> 0 Then
        $auxLink = $oLink
        ExitLoop
    EndIf
   Next
_FileWriteLog(@ScriptDir & "\Log_eContact.log", "8")
   _IEAction($auxLink, "click")
   if @error Then
      _IEQuit($oIE)
      Return "Error: No se encuentra el botón de 'Buscar'."
   EndIf

   funcionEspera($oFrameB)

   $oLinks = _IELinkGetCollection($oFrameB)
   $auxLink = Null
_FileWriteLog(@ScriptDir & "\Log_eContact.log", "9")
   For $oLink In $oLinks
   If StringInStr($oLink.id, "result_table[1].description") <> 0 Then
     $auxLink = $oLink
     ExitLoop
   EndIf
   Next
_FileWriteLog(@ScriptDir & "\Log_eContact.log", "10")
   _IEAction($auxLink, "click")
   if @error Then
      _IEQuit($oIE)
      Return "Error: No se encuentra el enlace de la solicitud " & $numeroPeticion & " en los resultados."
   EndIf

   funcionEspera($oFrameB)
_FileWriteLog(@ScriptDir & "\Log_eContact.log", "11")
   $oFrameA = _IEFrameGetObjByName($oIE, "contentAreaFrame")
   if @error Then
      _IEQuit($oIE)
      Return "Error: La página no ha cargado correctamente. Frame: 'contentAreaFrame'."
   EndIf
_FileWriteLog(@ScriptDir & "\Log_eContact.log", "12")
   $oFrameB = _IEFrameGetObjByName($oFrameA, "isolatedWorkArea")
   if @error Then
      _IEQuit($oIE)
      Return "Error: La página no ha cargado correctamente. Frame: 'isolatedWorkArea'."
   EndIf
_FileWriteLog(@ScriptDir & "\Log_eContact.log", "13")
   _IEQuit($oIE)

   Sleep(5000)

   Return ""

EndFunc

And now the script give the same error. The error is in the lines:

$oFrameA = _IEFrameGetObjByName($oIE, "contentAreaFrame")

The error is in the first _IEFrameGetObjByName($oIE, "contentAreaFrame") and in the second......

Help me please!!! xD

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

Global $oIE = _IECreate("https://econtact-ict.enelint.global/",0,1,1,0)
   While @error
      sleep(100)
      $oIE = _IECreate("https://econtact-ict.enelint.global/",0,1,1,0)
   WEnd

Try to not hidding IE and make some waiting (sleep) before you try open new IE.

 

Also add this:

_FileWriteLog(@ScriptDir & "\Log_eContact.log", "1")

   ; this should keep last HTML content - can be handy in further analysis
   FileWrite(@ScriptDir & "\Log_eContact.html", _IEDocReadHTML($oIE))
   Local $oFrameA = _IEFrameGetObjByName($oIE, "contentAreaFrame")

 

I think the problem is that after this:

Local $bBuzon = _IEGetObjById($oIE, "L2N1")
   _IEAction($bBuzon, "click")
   if @error Then
      _IEQuit($oIE)
      Return "Error: No se encuentra el enlace a 'Mis Solicitudes'."
   EndIf

your:

Sleep(5000)

It is not always sufficient .

 

Edited by mLipok

February 26, 2017: New SciTE4AutoIt3 available with the updated SciTE v3.7.3 release
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: 2017-02-26
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.au3 UDF * TeamViewer.au3 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

Hi,

I tried everything mLipok said me but it didn't solve my problem. 

I read the htmls generated by the code:

; this should keep last HTML content - can be handy in further analysis
   FileWrite(@ScriptDir & "\Log_eContact.html", _IEDocReadHTML($oIE))

I have write this code before the lines:

Local $oFrameA = _IEFrameGetObjByName($oIE, "isolatedWorkArea")

The HTMLs of the errors have the frame "contentAreaFrame" but its don't have the frame "isolatedWorkArea".

Can the error be because the script need a sleep after the getFrame "contentAreaFrame" and before the getFrame "isolatedWorkArea"??? 

 

Thank you for all!!

Share this post


Link to post
Share on other sites

I'm sorry but in all HTMLs don't appear the frame "isolatedWorkArea" so that it isn't the error.

I do not know what else to try.

Share this post


Link to post
Share on other sites

Hi,

I have solved the problem!! I read the topic of this forum:

I have tried catch the iframes with _IEFrameGetCollection with the attribute position of iframe and the error is solved.

My new code is:

Local $oFrameA = _IEFrameGetCollection($oIE, 1)
if @error Then
  _IEQuit($oIE)
  Return "Error: La página no ha cargado correctamente. Frame: 'contentAreaFrame'."
EndIf
Sleep(250)

Local $oFrameB = _IEFrameGetCollection($oFrameA, 0)
if @error Then
  _IEQuit($oIE)
  Return "Error: La página no ha cargado correctamente. Frame: 'isolatedWorkArea'."
EndIf
Sleep(250)

Thank you for all!!!

 

 

Share this post


Link to post
Share on other sites

You are welcome

mLipok

 


February 26, 2017: New SciTE4AutoIt3 available with the updated SciTE v3.7.3 release
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: 2017-02-26
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.au3 UDF * TeamViewer.au3 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

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