Jump to content
Sign in to follow this  
faustf

_ie strange problem

Recommended Posts

hi guys  i have  a  site  ,i  did do a  script  for  compile  it , and    compile it ,  but   when i push over  the  button for  confirm tell me i not  write  nothing  ,  and is  very strange  because  i see  i number  inside  te input  box

this  is  a  script 

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

Global $ISP_WEB = 0
_Spediamo_it_WEB()

Func _Spediamo_it_WEB()
    ;If $CmdLine[0] = "" Or $CmdLine[0] = "?" Then
    ;       _Help_Spediamo_web()
    ;   Else
    If ProcessExists("iexplore.exe") Then ; Check if the internet esplorer process is running.
        ProcessClose("iexplore.exe")
    EndIf

    Global $oIE = _IECreate("http://www.spediamo.it/spedizioni-internazionali-import", 0, 1, 1, 1) ; <--- 0011 invisible explorer  <--- 0111 visible explorer
    _IELoadWait($oIE)


    Local $dacancellare = "Buste"
    Select
        Case $dacancellare = "Buste"
            $ISP_WEB = 0
            Local $oBuste = _IEImgClick($oIE, "img/busta.png", "src")
            _IEAction($oBuste, "focus")
            _IEAction($oBuste, "Click")
            _IELoadWait($oIE)
        Case $dacancellare = "Pacchi"
            $ISP_WEB = 1
            ;Local $oPacchi = _IEImgClick($oIE, "img/pacco.png", "src")
        Case $dacancellare = "Valige"
            $ISP_WEB = 2
            Local $oValige = _IEImgClick($oIE, "img/valigia.png", "src")
            _IEAction($oValige, "focus")
            _IEAction($oValige, "Click")
            _IELoadWait($oIE)
        Case $dacancellare = "Pellets"
            $ISP_WEB = 3
            Local $oPallet = _IEImgClick($oIE, "img/pallet.png", "src")
            _IEAction($oPallet, "focus")
            _IEAction($oPallet, "Click")
            _IELoadWait($oIE)
    EndSelect

    Sleep(500)
    ;MsgBox(0, '', $ISP_WEB & "::0::BOX::number")
    Local $oColli = _IEGetObjByName($oIE, $ISP_WEB & "::0::BOX::number")
    _IEAction($oColli, "focus")
    _IEAction($oColli, "Click")
    _IEFormElementSetValue($oColli, "1")

    Local $oPeso = _IEGetObjByName($oIE, $ISP_WEB & "::0::BOX::weigth")
    _IEAction($oPeso, "focus")
    _IEAction($oPeso, "Click")
    _IEFormElementSetValue($oPeso, "10")

    Local $oAltezza = _IEGetObjByName($oIE, $ISP_WEB & "::0::BOX::height")
    _IEAction($oAltezza, "focus")
    _IEAction($oAltezza, "Click")
    _IEFormElementSetValue($oAltezza, "15")

    Local $oLargezza = _IEGetObjByName($oIE, $ISP_WEB & "::0::BOX::length")
    _IEAction($oLargezza, "focus")
    _IEAction($oLargezza, "Click")
    _IEFormElementSetValue($oLargezza, "17")

    Local $oProfondita = _IEGetObjByName($oIE, $ISP_WEB & "::0::BOX::depth")
    _IEAction($oProfondita, "focus")
    _IEAction($oProfondita, "Click")
    _IEFormElementSetValue($oProfondita, "19")


    Local $o1Step = _IEImgClick($oIE, "img/spedisci.png", "src")
    _IEAction($o1Step, "focus")
    _IEAction($o1Step, "Click")
    _IELoadWait($oIE)


    ;-------------------------------------------------------------------------------------
    ;--------- RITIRA PRESSO -------------------------------------------------------------
    Local $oCognomeMIT = _IEGetObjByName($oIE, "SENDER::name")
    _IEAction($oCognomeMIT, "focus")
    _IEAction($oCognomeMIT, "Click")
    _IEFormElementSetValue($oCognomeMIT, "lopresti armando")

    Local $oProvinciaMIT = _IEGetObjByName($oIE, "SENDER::country")
    _IEAction($oProvinciaMIT, "focus")
    _IEAction($oProvinciaMIT, "Click")
    _IEFormElementOptionSelect($oProvinciaMIT, "Bulgaria", 1, "byText")

    Sleep(3000)
    Local $oCityMIT = _IEGetObjByName($oIE, "SENDER::town")
    _IEAction($oCityMIT, "focus")
    _IEAction($oCityMIT, "Click")
    _IEFormElementSetValue($oCityMIT, "fucecchio")

    Local $oCapMIT = _IEGetObjByName($oIE, "SENDER::postalCode")
    _IEAction($oCapMIT, "focus")
    _IEAction($oCapMIT, "Click")
    _IEFormElementSetValue($oCapMIT, "50054")

    Local $oIndirizzoMIT = _IEGetObjByName($oIE, "SENDER::address")
    _IEAction($oIndirizzoMIT, "focus")
    _IEAction($oIndirizzoMIT, "Click")
    _IEFormElementSetValue($oIndirizzoMIT, "via tal dei tali")

    Local $oNominativoMIT = _IEGetObjByName($oIE, "SENDER::contactName")
    _IEAction($oNominativoMIT, "focus")
    _IEAction($oNominativoMIT, "Click")
    _IEFormElementSetValue($oNominativoMIT, "armando")

    Local $oCellulareMIT = _IEGetObjByName($oIE, "SENDER::mobile")
    _IEAction($oCellulareMIT, "focus")
    _IEAction($oCellulareMIT, "Click")
    _IEFormElementSetValue($oCellulareMIT, "33326363563")


    Local $oTriangola = _IEGetObjByName($oIE, "form_order")

    Local $cosa = _IEFormElementCheckBoxSelect($oTriangola, 0, "billing_address_in_waybill", 1, "byIndex")

    Local $o2Step = _IEImgClick($oIE, "img/spedisci.png", "src")
    _IEAction($o2Step, "focus")
    _IEAction($o2Step, "Click")
    _IELoadWait($oIE)
    Sleep(3000)
    ;-------------------------------------------------------------------------------------
    ;---- CONDSEGNA A --------------------------------------------------------------------
    Local $oCognomeDEST = _IEGetObjByName($oIE, "RECIPIENT::name")
    _IEAction($oCognomeDEST, "focus")
    _IEAction($oCognomeDEST, "Click")
    _IEFormElementSetValue($oCognomeDEST, "lopresti armando")

    Local $oProvinciaDEST = _IEGetObjByName($oIE, "RECIPIENT::province")
    _IEAction($oProvinciaDEST, "focus")
    Sleep(3000)
    _IEFormElementOptionSelect($oProvinciaDEST, "FI - Firenze", 1, "byText")

    Local $oCittaDEST = _IEGetObjByName($oIE, "RECIPIENT::town")
    _IEAction($oCittaDEST, "focus")
    Sleep(3000)
    _IEFormElementOptionSelect($oCittaDEST, "Fucecchio", 1, "byText")
    #cs
        Sleep(3000)
        Local $oCapDEST = _IEGetObjByName($oIE, "RECIPIENT::postalCode")
        _IEAction($oCapDEST, "focus")
        _IEFormElementOptionSelect($oCapDEST, "50054", 1, "byText")
    #ce
    Local $oIndirizzoDEST = _IEGetObjByName($oIE, "RECIPIENT::address")
    _IEAction($oIndirizzoDEST, "focus")
    _IEAction($oIndirizzoDEST, "Click")
    _IEFormElementSetValue($oIndirizzoDEST, "via tal dei tali")

    Local $oNominativoDEST = _IEGetObjByName($oIE, "RECIPIENT::contactName")
    _IEAction($oNominativoDEST, "focus")
    _IEAction($oNominativoDEST, "Click")
    _IEFormElementSetValue($oNominativoDEST, "armando")

    Local $oCellulareDEST = _IEGetObjByName($oIE, "RECIPIENT::mobile")
    _IEAction($oCellulareDEST, "focus")
    _IEAction($oCellulareDEST, "Click")
    _IEFormElementSetValue($oCellulareDEST, "33326363563")

        Local $o3Step = _IEImgClick($oIE, "img/spedisci.png", "src")
    _IEAction($o3Step, "focus")
    _IEAction($o3Step, "Click")
    _IELoadWait($oIE)
    ;Sleep(5000)
    ;-------------------------------------------------------------------------------------
    ;-----   CONFERMARE ORDINE -----------------------------------------------------------

    Sleep(3000)
    ;MsgBox(0,'','')
    Local $oFirstCheckBox = _IEGetObjByClass($oIE, "selectable")
    If IsObj($oFirstCheckBox) Then
        $oFirstCheckBox.checked = True
    EndIf


    Local $teste1 = _IEImgClick($oIE, "img/spedisci.png", "src")

    ; --- PAGAMENTO --------------------------------------------------------------------
    Sleep(2000)
    MsgBox(0, 'Info', 'Adesso puoi porcedre a mano', 5)

    ;EndIf
EndFunc   ;==>_Spediamo_it_WEB

#cs
    Func    _Help_Spediamo_web()

    MsgBox(0, "Info", "devi richiamare l'eseguibile con i parametri altrimenti si blocca")
    EndFunc
#ce

Func _IEGetObjByClass(ByRef $o_object, $s_Class, $i_index = 0)
    If Not IsObj($o_object) Then
        __IEConsoleWriteError("Error", "_IEGetObjByClass", "$_IEStatus_InvalidDataType")
        SetError($_IEStatus_InvalidDataType, 1)
        Return 0
    EndIf
    ;
    If Not __IEIsObjType($o_object, "browserdom") Then
        __IEConsoleWriteError("Error", "_IEGetObjByClass", "$_IEStatus_InvalidObjectType")
        SetError($_IEStatus_InvalidObjectType, 1)
        Return 0
    EndIf
    ;
    Local $i_found = 0
    ;
    $o_tags = _IETagNameAllGetCollection($o_object)
    For $o_tag In $o_tags
        If String($o_tag.className) = $s_Class Then
            If ($i_found = $i_index) Then
                SetError($_IEStatus_Success)
                Return $o_tag
            Else
                $i_found += 1
            EndIf
        EndIf
    Next
    ;
    __IEConsoleWriteError("Warning", "_IEGetObjByClass", "$_IEStatus_NoMatch", $s_Class)
    SetError($_IEStatus_NoMatch, 2)
    Return 0
EndFunc   ;==>_IEGetObjByClass

some one  have  idea  why ???  thankz  alot

 

Share this post


Link to post
Share on other sites

in practic, if  you run my script  ,  it  work  good , insert  data in page html , but  when  at  finish  push  last  button (in page)  the  page  answer , like  if i dont  insert nothing  in the page

 

Share this post


Link to post
Share on other sites

1. there are errors:

>Running:(3.3.14.2):C:\Program Files\AutoIt3\autoit3.exe "C:\Users\Bert\AutoIt3.My\Source\test4.au3"    
--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
--> IE.au3 T3.0-2 Error from function _IEAction(focus), $_IESTATUS_InvalidDataType
--> IE.au3 T3.0-2 Error from function _IEAction(Click), $_IESTATUS_InvalidDataType
--> IE.au3 T3.0-2 Error from function _IEAction(focus), $_IESTATUS_InvalidDataType
--> IE.au3 T3.0-2 Error from function _IEAction(Click), $_IESTATUS_InvalidDataType
--> IE.au3 T3.0-2 Error from function _IEAction(focus), $_IESTATUS_InvalidDataType
--> IE.au3 T3.0-2 Error from function _IEAction(Click), $_IESTATUS_InvalidDataType
--> IE.au3 T3.0-2 Error from function _IEAction(focus), $_IESTATUS_InvalidDataType
--> IE.au3 T3.0-2 Error from function _IEAction(Click), $_IESTATUS_InvalidDataType
--> IE.au3 T3.0-2 Warning from function _IEGetObjByClass, $_IEStatus_NoMatch (selectable)

2. didn't you see the warning:

Quote

Attenzione: per finalizzare la quotazione, devi indicare OBBLIGATORIAMENTE la nazione in Ritira presso

 

Share this post


Link to post
Share on other sites

 

2. yea  but   i saw  the  warning , but  my script  insert all , in theory   not should the  error .

i  try to  resolve  the  error 1

thankz  agian

 

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
Sign in to follow this  

×
×
  • Create New...