faustf

bug of ie.au3 ???

10 posts in this topic

hi guy i try to create a script for  automate  shipment in site the  script is  this

#include <MsgBoxConstants.au3>
#include <WinAPIFiles.au3>
#include <File.au3>
#include <IE.au3>


Func _Truckpooling_it_WEB($Buste_Pacchi_Pllets)
    If ProcessExists("iexplore.exe") Then ; Check if the internet esplorer process is running.
        ProcessClose("iexplore.exe")
    EndIf

    Global $oIE = _IECreate("http://www.truckpooling.it/", 0, 1, 1, 1) ; <--- 0011 invisible explorer  <--- 0111 visible explorer
    _IELoadWait($oIE)
    Local $oDiv = _IEGetObjById($oIE, "div_login-toggle")
    _IEAction($oDiv, "focus")
    _IEAction($oDiv, "Click")
    _IELoadWait($oIE)
    Local $oLogin = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$txtEmail")
    _IEAction($oLogin, "focus")
    _IEAction($oLogin, "Click")
    _IEFormElementSetValue($oLogin, "faust@yopmail.com")
    ;   Sleep(1000)
    Local $oPassword = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$txtPassword")
    _IEAction($oPassword, "focus")
    _IEAction($oPassword, "Click")
    _IEFormElementSetValue($oPassword, "qazwsxedc")
    ;   Sleep(1000)
    ;MsgBox (0,'','39')
    Local $oBottonLogin = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$btnLogin")
    _IEAction($oBottonLogin, "focus")
    _IEAction($oBottonLogin, "Click")
    _IELoadWait($oIE)
    Sleep(4000)
    ;----  INSERISCI  SPEDIZIONI ---------------------------------------------------------------------

    Select
        Case $Buste_Pacchi_Pllets = "Buste"
            Local $oBuste = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$btnBusta")
            _IEAction($oBuste, "focus")
            _IEAction($oBuste, "Click")
        Case $Buste_Pacchi_Pllets = "Pacchi"
            ;   Local $oPacchi = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$btnCollo")
            ;   _IEAction($oPacchi, "focus")
            ;   _IEAction($oPacchi, "Click")
        Case $Buste_Pacchi_Pllets = "Pellets"
            Local $oPallet = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$btnPallet")
            _IEAction($oPallet, "focus")
            _IEAction($oPallet, "Click")
    EndSelect
    ; questo blocco va  abilitato per scegliere trasporot internazionale o meno
    #cs
        Local $oNazioneMIT = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$cmbNazioneMittente")
        _IEAction($oNazioneMIT, "focus")
        _IEFormElementOptionSelect($oNazioneMIT, "ITALIA", 1, "byText")
        Sleep(3000)
        Local $oNazioneDEST = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$cmbNazioneDestinazione")
        _IEAction($oNazioneDEST, "focus")
        _IEFormElementOptionSelect($oNazioneDEST, "ITALIA", 1, "byText")
    #ce
    Local $oCittaMIT = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$txtLocalitaMittente")
    _IEAction($oCittaMIT, "focus")
    _IEAction($oCittaMIT, "Click")
    _IEFormElementSetValue($oCittaMIT, "50054 - fucecchio")

    Local $oCittaDEST = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$txtLocalitaDestinatario")
    _IEAction($oCittaDEST, "focus")
    _IEAction($oCittaDEST, "Click")
    _IEFormElementSetValue($oCittaDEST, "56121 - Pisa")

    Local $oColli = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$txtQuantita1")
    _IEAction($oColli, "focus")
    _IEAction($oColli, "Click")
    _IEFormElementSetValue($oColli, "1")

    Local $oPeso = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$txtPeso1")
    _IEAction($oPeso, "focus")
    _IEAction($oPeso, "Click")
    _IEFormElementSetValue($oPeso, "10")

    Local $oAltezza = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$txtAltezza1")
    _IEAction($oAltezza, "focus")
    _IEAction($oAltezza, "Click")
    _IEFormElementSetValue($oAltezza, "12")

    Local $oLargezza = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$txtLarghezza1")
    _IEAction($oLargezza, "focus")
    _IEAction($oLargezza, "Click")
    _IEFormElementSetValue($oLargezza, "13")

    Local $oProfondita = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$txtProfondita1")
    _IEAction($oProfondita, "focus")
    _IEAction($oProfondita, "Click")
    _IEFormElementSetValue($oProfondita, "24")

    Local $oBottonQuot = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$btnQuotazioni")
    _IEAction($oBottonQuot, "focus")
    _IEAction($oBottonQuot, "Click")
    _IELoadWait($oIE)
    Sleep(7000)
    ; scegli a mano la spedizione che preferisci oppure automatizza sul primo prezzo  , settare nelle opzioni

    Local $oBottonQuot1 = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$compra1")
    _IEAction($oBottonQuot1, "focus")
    _IEAction($oBottonQuot1, "Click")
    _IELoadWait($oIE)

    ;-------------------------------------------------------------------------------------------------
    ;----- DETTAGLI SPEDIZIONE -----------------------------------------------------------------------
    Local $oNomeMIT = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$txtNomeRitiro")
    _IEAction($oNomeMIT, "focus")
    _IEAction($oNomeMIT, "Click")
    _IEFormElementSetValue($oNomeMIT, "armando")

    Local $oCognomeMIT = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$txtCognomeRitiro")
    _IEAction($oCognomeMIT, "focus")
    _IEAction($oCognomeMIT, "Click")
    _IEFormElementSetValue($oCognomeMIT, "lopresti")

    Local $oTelefonoMIT = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$txtTelefonoRitiro")
    _IEAction($oTelefonoMIT, "focus")
    _IEAction($oTelefonoMIT, "Click")
    _IEFormElementSetValue($oTelefonoMIT, "333636636")

    Local $oEmailMIT = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$txtEmailRitiro")
    _IEAction($oEmailMIT, "focus")
    _IEAction($oEmailMIT, "Click")
    _IEFormElementSetValue($oEmailMIT, "armando@yopmail.com")

    Local $oAddresMIT = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$txtIndirizzoRitiro")
    _IEAction($oAddresMIT, "focus")
    _IEAction($oAddresMIT, "Click")
    _IEFormElementSetValue($oAddresMIT, "via tal dei tali")

    Local $oTriangMIT = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$cbxNascondiTriangolazione")
    _IEAction($oTriangMIT, "focus")
    _IEAction($oTriangMIT, "Click")
    ;-------------------------------------------------------------------------------------------------
    ;---- DATI DI CONSEGNA ---------------------------------------------------------------------------
    Local $oNomeDEST = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$txtNomeDestinatario")
    _IEAction($oNomeDEST, "focus")
    _IEAction($oNomeDEST, "Click")
    _IEFormElementSetValue($oNomeDEST, "armando")

    Local $oCognomeDEST = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$txtCognomeDestinatario")
    _IEAction($oCognomeDEST, "focus")
    _IEAction($oCognomeDEST, "Click")
    _IEFormElementSetValue($oCognomeDEST, "lopresti")

    Local $oTelefonoDEST = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$txtTelefonoDestinatario")
    _IEAction($oTelefonoDEST, "focus")
    _IEAction($oTelefonoDEST, "Click")
    _IEFormElementSetValue($oTelefonoDEST, "333636636")

    Local $oAddresDEST = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$txtIndirizzoDestinatario")
    _IEAction($oAddresDEST, "focus")
    _IEAction($oAddresDEST, "Click")
    _IEFormElementSetValue($oAddresDEST, "via tal dei tali")

    Local $oBottFinishOrder = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$btnConcludi")
    _IEAction($oBottFinishOrder, "focus")
    _IEAction($oBottFinishOrder, "Click")
    ;-------------------------------------------------------------------------------------------------
    ;------- PAGAMENTO -------------------------------------------------------------------------------
    Local $oCUtilizzo = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$cbxCondizioniUtilizzoSito")
    _IEAction($oCUtilizzo, "focus")
    _IEAction($oCUtilizzo, "Click")

    Local $oCPrivacy = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$cbxPrivacy")
    _IEAction($oCPrivacy, "focus")
    _IEAction($oCPrivacy, "Click")

    Local $oCTrasporto = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$cbxCondizioniUtilizzoTrasporto")
    _IEAction($oCTrasporto, "focus")
    _IEAction($oCTrasporto, "Click")

    Local $oCPayPal = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$grpPagamento")
    _IEAction($oCPayPal, "focus")
    _IEAction($oCPayPal, "Click")

    Local $oButtSpedisci = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$btnSpedisci")
    _IEAction($oButtSpedisci, "focus")
    _IEAction($oButtSpedisci, "Click")
    ;-------------------------------------------------------------------------------------------------
EndFunc   ;==>_Truckpooling_it_WEB

my script  sometime  go perfect  and  often  give me   this  error

"C:\Program Files\AutoIt3\Include\IE.au3" (1875) : ==> The requested action with this object has failed.:
If IsObj($oObject.document.GetElementsByName($sName).item($iIndex)) Then
If IsObj($oObject.document^ ERROR
->15:51:00 AutoIt3.exe ended.rc:1
+>15:51:00 AutoIt3Wrapper Finished.
>Exit code: 1    Time: 20.14


some  time  this  error appear   before login in site

some time often  after this  part of  code

Local $oProfondita = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$txtProfondita1")
    _IEAction($oProfondita, "focus")
    _IEAction($oProfondita, "Click")
    _IEFormElementSetValue($oProfondita, "24")

some one  have  idea  why  ???

thankz at all

 

 

Share this post


Link to post
Share on other sites



Your code works for me (tried it only once).
This kind of error often occurs when the page is not fully loaded, so you might place some sleep's - or do some checkings

Share this post


Link to post
Share on other sites

ok thankz @mikell probably connection  is too slow  today

 

Share this post


Link to post
Share on other sites

i  think  is  a  bug of  IE.au3

because  i  insert  also pause

and  do the  same  i saw  the  page  is compleatly load , but do the same effect

 

#include <MsgBoxConstants.au3>
#include <WinAPIFiles.au3>
#include <File.au3>
#include <IE.au3>

local $Buste_Pacchi_Pllets = "Pacchi"
_Truckpooling_it_WEB($Buste_Pacchi_Pllets)


Func _Truckpooling_it_WEB($Buste_Pacchi_Pllets)
Local $sleepButt = 4000
Local $sleepPass = 1500
    If ProcessExists("iexplore.exe") Then ; Check if the internet esplorer process is running.
        ProcessClose("iexplore.exe")
    EndIf

    Global $oIE = _IECreate("http://www.truckpooling.it/", 0, 1, 1, 1) ; <--- 0011 invisible explorer  <--- 0111 visible explorer
    _IELoadWait($oIE)
    Local $oDiv = _IEGetObjById($oIE, "div_login-toggle")
    _IEAction($oDiv, "focus")
    _IEAction($oDiv, "Click")
    _IELoadWait($oIE)
    Local $oLogin = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$txtEmail")
    _IEAction($oLogin, "focus")
    _IEAction($oLogin, "Click")
    _IEFormElementSetValue($oLogin, "faust@yopmail.com")
    Sleep($sleepPass)
    Local $oPassword = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$txtPassword")
    _IEAction($oPassword, "focus")
    _IEAction($oPassword, "Click")
    _IEFormElementSetValue($oPassword, "qazwsxedc")
    Sleep($sleepPass)
    ;MsgBox (0,'','39')
    Local $oBottonLogin = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$btnLogin")
    _IEAction($oBottonLogin, "focus")
    _IEAction($oBottonLogin, "Click")
    _IELoadWait($oIE)
    Sleep($sleepButt)
    ;----  INSERISCI  SPEDIZIONI ---------------------------------------------------------------------

    Select
        Case $Buste_Pacchi_Pllets = "Buste"
            Local $oBuste = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$btnBusta")
            _IEAction($oBuste, "focus")
            _IEAction($oBuste, "Click")
            _IELoadWait($oIE)
        Case $Buste_Pacchi_Pllets = "Pacchi"
            ;   Local $oPacchi = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$btnCollo")
            ;   _IEAction($oPacchi, "focus")
            ;   _IEAction($oPacchi, "Click")
        Case $Buste_Pacchi_Pllets = "Pellets"
            Local $oPallet = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$btnPallet")
            _IEAction($oPallet, "focus")
            _IEAction($oPallet, "Click")
            _IELoadWait($oIE)
    EndSelect
    ; questo blocco va  abilitato per scegliere trasporot internazionale o meno
    #cs
        Local $oNazioneMIT = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$cmbNazioneMittente")
        _IEAction($oNazioneMIT, "focus")
        _IEFormElementOptionSelect($oNazioneMIT, "ITALIA", 1, "byText")
        Sleep(3000)
        Local $oNazioneDEST = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$cmbNazioneDestinazione")
        _IEAction($oNazioneDEST, "focus")
        _IEFormElementOptionSelect($oNazioneDEST, "ITALIA", 1, "byText")
    #ce
    Local $oCittaMIT = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$txtLocalitaMittente")
    _IEAction($oCittaMIT, "focus")
    _IEAction($oCittaMIT, "Click")
    _IEFormElementSetValue($oCittaMIT, "50054 - fucecchio")
    Sleep($sleepPass)

    Local $oCittaDEST = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$txtLocalitaDestinatario")
    _IEAction($oCittaDEST, "focus")
    _IEAction($oCittaDEST, "Click")
    _IEFormElementSetValue($oCittaDEST, "56121 - Pisa")
    Sleep($sleepPass)
    Local $oColli = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$txtQuantita1")
    _IEAction($oColli, "focus")
    _IEAction($oColli, "Click")
    _IEFormElementSetValue($oColli, "1")
    Sleep($sleepPass)
    Local $oPeso = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$txtPeso1")
    _IEAction($oPeso, "focus")
    _IEAction($oPeso, "Click")
    _IEFormElementSetValue($oPeso, "10")
    Sleep($sleepPass)
    Local $oAltezza = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$txtAltezza1")
    _IEAction($oAltezza, "focus")
    _IEAction($oAltezza, "Click")
    _IEFormElementSetValue($oAltezza, "12")
    Sleep($sleepPass)
    Local $oLargezza = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$txtLarghezza1")
    _IEAction($oLargezza, "focus")
    _IEAction($oLargezza, "Click")
    _IEFormElementSetValue($oLargezza, "13")
    Sleep($sleepPass)
    Local $oProfondita = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$txtProfondita1")
    _IEAction($oProfondita, "focus")
    _IEAction($oProfondita, "Click")
    _IEFormElementSetValue($oProfondita, "24")
    Sleep($sleepPass)
    Local $oBottonQuot = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$btnQuotazioni")
    _IEAction($oBottonQuot, "focus")
    _IEAction($oBottonQuot, "Click")
    _IELoadWait($oIE)
    Sleep($sleepButt)
    ; scegli a mano la spedizione che preferisci oppure automatizza sul primo prezzo  , settare nelle opzioni

    Local $oBottonQuot1 = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$compra1")
    _IEAction($oBottonQuot1, "focus")
    _IEAction($oBottonQuot1, "Click")
    _IELoadWait($oIE)
    Sleep($sleepPass)
    ;-------------------------------------------------------------------------------------------------
    ;----- DETTAGLI SPEDIZIONE -----------------------------------------------------------------------
    Local $oNomeMIT = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$txtNomeRitiro")
    _IEAction($oNomeMIT, "focus")
    _IEAction($oNomeMIT, "Click")
    _IEFormElementSetValue($oNomeMIT, "armando")
    Sleep($sleepPass)
    Local $oCognomeMIT = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$txtCognomeRitiro")
    _IEAction($oCognomeMIT, "focus")
    _IEAction($oCognomeMIT, "Click")
    _IEFormElementSetValue($oCognomeMIT, "lopresti")
    Sleep($sleepPass)
    Local $oTelefonoMIT = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$txtTelefonoRitiro")
    _IEAction($oTelefonoMIT, "focus")
    _IEAction($oTelefonoMIT, "Click")
    _IEFormElementSetValue($oTelefonoMIT, "333636636")
    Sleep($sleepPass)
    Local $oEmailMIT = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$txtEmailRitiro")
    _IEAction($oEmailMIT, "focus")
    _IEAction($oEmailMIT, "Click")
    _IEFormElementSetValue($oEmailMIT, "armando@yopmail.com")
    Sleep($sleepPass)
    Local $oAddresMIT = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$txtIndirizzoRitiro")
    _IEAction($oAddresMIT, "focus")
    _IEAction($oAddresMIT, "Click")
    _IEFormElementSetValue($oAddresMIT, "via tal dei tali")
    Sleep($sleepPass)
    Local $oTriangMIT = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$cbxNascondiTriangolazione")
    _IEAction($oTriangMIT, "focus")
    _IEAction($oTriangMIT, "Click")
    ;-------------------------------------------------------------------------------------------------
    ;---- DATI DI CONSEGNA ---------------------------------------------------------------------------
    Local $oNomeDEST = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$txtNomeDestinatario")
    _IEAction($oNomeDEST, "focus")
    _IEAction($oNomeDEST, "Click")
    _IEFormElementSetValue($oNomeDEST, "armando")
    Sleep(500)
    Local $oCognomeDEST = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$txtCognomeDestinatario")
    _IEAction($oCognomeDEST, "focus")
    _IEAction($oCognomeDEST, "Click")
    _IEFormElementSetValue($oCognomeDEST, "lopresti")
    Sleep(500)
    Local $oTelefonoDEST = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$txtTelefonoDestinatario")
    _IEAction($oTelefonoDEST, "focus")
    _IEAction($oTelefonoDEST, "Click")
    _IEFormElementSetValue($oTelefonoDEST, "333636636")
    Sleep(500)
    Local $oAddresDEST = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$txtIndirizzoDestinatario")
    _IEAction($oAddresDEST, "focus")
    _IEAction($oAddresDEST, "Click")
    _IEFormElementSetValue($oAddresDEST, "via tal dei tali")
    Sleep(500)
    Local $oBottFinishOrder = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$btnConcludi")
    _IEAction($oBottFinishOrder, "focus")
    _IEAction($oBottFinishOrder, "Click")
    _IELoadWait($oIE)
    Sleep($sleepButt)
    ;-------------------------------------------------------------------------------------------------
    ;------- PAGAMENTO -------------------------------------------------------------------------------
    ;MsgBox(0,'','inizio pago')
    Local $oCUtilizzo = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$cbxCondizioniUtilizzoSito")
    _IEAction($oCUtilizzo, "focus")
    _IEAction($oCUtilizzo, "Click")
    Sleep(1000)
    Local $oCPrivacy = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$cbxPrivacy")
    _IEAction($oCPrivacy, "focus")
    _IEAction($oCPrivacy, "Click")
    Sleep(1000)
    Local $oCTrasporto = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$cbxCondizioniUtilizzoTrasporto")
    _IEAction($oCTrasporto, "focus")
    _IEAction($oCTrasporto, "Click")
    Sleep(1000)
    Local $oCPayPal = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$grpPagamento")
    _IEAction($oCPayPal, "focus")
    _IEAction($oCPayPal, "Click")
    Sleep(1000)
    Local $oButtSpedisci = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$btnSpedisci")
    _IEAction($oButtSpedisci, "focus")
    _IEAction($oButtSpedisci, "Click")
    _IELoadWait($oIE)
    Sleep($sleepButt)
    ;-------------------------------------------------------------------------------------------------
EndFunc   ;==>_Truckpooling_it_WEB

someone  have  idea for resolve it ???

 

Share this post


Link to post
Share on other sites

I don't think that it's an ie.au3 bug.
perhaps you are calling an ie.au3 function passing an obj as argument while the obj is still not an ready made obj.
inserting pause is not a bullet proof way, because you do not know how long the pause should wait. you can only try to guess. (also, it seems that you inserted the pause after the function call.... you should rather insert the pause before the call to the ie.au3 function)
anyway, instead of using a pause, you could try to use a loop to wait till an obj is ready using a way like this for example:

Local $oCUtilizzo = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$cbxCondizioniUtilizzoSito")
    
    Do ; stay here untill the $oCUtilizzo object is ready (untill is an obj)
    Until IsObj($oCUtilizzo)
    
    ; now you can call in a safe way the ie.au3 functions that requires an obj as argument
    _IEAction($oCUtilizzo, "focus")
    _IEAction($oCUtilizzo, "Click")

 

1 person likes this

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Share this post


Link to post
Share on other sites


@Chimp are you cooking, or warming up ?

Do ; stay here untill the $oCUtilizzo object is ready (untill is an obj)
        Sleep(10)
    Until IsObj($oCUtilizzo)

 

1 person likes this

Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
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

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 SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer 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 * _IEquerySelectorAll() (by uncommon) * 

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."

Signature last update: 2017-06-04

Share this post


Link to post
Share on other sites

Great  :)

May I suggest

Do
   $source = $oIE.document.body.innerhtml
Until StringInStr($source, "ctl00$ContentPlaceHolder1$cbxCondizioniUtilizzoSito")

Local $oCUtilizzo = _IEGetObjByName($oIE, "ctl00$ContentPlaceHolder1$cbxCondizioniUtilizzoSito")
; etc

 

 

1 person likes this

Share this post


Link to post
Share on other sites

thankz  Bro  now  work good  :)

 

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

i try  all solution but    some  times  go and  often  crashed 

"C:\Program Files\AutoIt3\Include\IE.au3" (1899) : ==> The requested action with this object has failed.:
If IsObj($oObject.document.getElementById($sID)) Then
If IsObj($oObject.document^ ERROR

and some time  also autoit v3  freezz

:( i try  to reinistall also autoit

Edited by faustf

Share this post


Link to post
Share on other sites

What about you start doing some debugging yourself before posting. It is now said regurlarly lately to you and we are slowly getting at a point that we might forcefully slow you down and force you to bring that brain in gear!

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.