_IELoadWait bei JS-Fehler

  • Hallo Leute,

    und zwar habe ich Probleme mit dem _IELoadWait.
    Ich klicke auf einen Button und die Seite wird anschließend submittet. Bis vor einigen Tagen ging das Ganze noch, aber neuerdings taucht bei dem Buttonklick kurzzeitig ein JS-Fehler auf. Das Formular wird aber trotzdem submittet.
    Seitdem dieser JS-Fehler da ist, macht Autoit allerdings keinen _IELoadWait mehr.

    Weiß einer warum ?

    Die MsgBox "Davor" erscheint noch, aber die mit "Nachher" leider nicht mehr, sondern erst, wenn ich erneut eine Browser Seite aufrufe.

    [autoit]

    Local $oSubmit = _IEGetObjById($oIE, "IAgreeBtn")
    _IEAction($oSubmit, "click")
    MsgBox(0, "", "Davor.")
    _IELoadWait($oIE)
    MsgBox(0, "", "Nachher.")

    [/autoit]
  • Hallo!
    Als du könntest es so probieren:

    Spoiler anzeigen
    [autoit]

    while 1
    if _ProcessGetCPU("iexplore.exe") = 0 then ExitLoop
    WEnd
    Func _ProcessGetCPU($strProcess = "Idle", $iSampleTime = 500, $sComputerName = @ComputerName)

    [/autoit] [autoit][/autoit] [autoit]

    ;~ All Parameters are optional:
    ;~ - Idle process will be measured if first parameter is not set
    ;~ - 500 ms is default sample time
    ;~ - This computer will be measured by default
    ;~ Process could be string ("Name") or PID number (1234)
    ;~ When more processes are runing with identical name, then the last opened is measured (use PID for other)
    ;~ For NORMAL MODE(one time measuring): set Sample value to more than 0 ms
    ;~ ( average CPU usage will be measured during sleep time within function)
    ;~ For LOOP MODE (continuous measuring): set Sample value to 0 ms
    ;~ ( average CPU usage will be measured between two function calls )
    ;~ Total CPU usage is: ( 100 - _ProcessGetCPU())
    ;~ Success: Returns process CPU usage in percent
    ;~ (Sample times below 100ms may return inaccurate results)
    ;~ (First result in Loop Mode may be inaccurate,
    ;~ because first call in Loop Mode is only used to trigger counters)
    ;~ Failure: Returns -1 ( wrong process name or PID )
    ;~ : Returns -2 ( WMI service not found or Computer not found)

    [/autoit] [autoit][/autoit] [autoit]

    if $strProcess = "" then $strProcess = "Idle"
    if $iSampleTime = "" AND IsString($iSampleTime) then $iSampleTime = 500
    if $sComputerName = "" then $sComputerName = @ComputerName

    [/autoit] [autoit][/autoit] [autoit]

    if not IsDeclared("iP1") AND $iSampleTime = 0 then ;first time in loop mode
    $bFirstTimeInLoopMode = 1
    else
    $bFirstTimeInLoopMode = 0
    endif

    [/autoit] [autoit][/autoit] [autoit]

    if not IsDeclared("iP1") then
    assign("iP1", 0, 2) ;forced global declaration first time
    assign("iT1", 0, 2)
    endif

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    $objWMIService = ObjGet("winmgmts:\\" & $sComputerName & "\root\CIMV2")
    if @error then return -2

    [/autoit] [autoit][/autoit] [autoit]

    if number($strProcess) then
    $strProcess = " WHERE IDProcess = '" & $strProcess & "'"
    else
    $strProcess = " WHERE Name = '" & $strProcess & "'"
    endif

    [/autoit] [autoit][/autoit] [autoit]

    if $iSampleTime OR $bFirstTimeInLoopMode = 1 then ;skip if Loop Mode, but not First time

    [/autoit] [autoit][/autoit] [autoit]

    $colItems = $objWMIService.ExecQuery ("SELECT * FROM Win32_PerfRawData_PerfProc_Process" & $strProcess)

    [/autoit] [autoit][/autoit] [autoit]

    For $objItem In $colItems

    [/autoit] [autoit][/autoit] [autoit]

    $iT1 = $objItem.TimeStamp_Sys100NS
    $iP1 = $objItem.PercentProcessorTime
    next

    [/autoit] [autoit][/autoit] [autoit]

    if $objItem = "" then return -1 ;process not found

    [/autoit] [autoit][/autoit] [autoit]

    sleep($iSampleTime)
    endif

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    $colItems = $objWMIService.ExecQuery ("SELECT * FROM Win32_PerfRawData_PerfProc_Process" & $strProcess)

    [/autoit] [autoit][/autoit] [autoit]

    For $objItem In $colItems

    [/autoit] [autoit][/autoit] [autoit]

    $iP2 = $objItem.PercentProcessorTime
    $iT2 = $objItem.TimeStamp_Sys100NS
    next

    [/autoit] [autoit][/autoit] [autoit]

    if $objItem = "" then return -1 ;process not found

    [/autoit] [autoit][/autoit] [autoit]

    $iPP = ($iP2 - $iP1)
    $iTT = ($iT2 - $iT1)

    [/autoit] [autoit][/autoit] [autoit]

    if $iTT = 0 Then return 100 ;do not divide by 0

    [/autoit] [autoit][/autoit] [autoit]

    $iCPU = round( ($iPP/$iTT) * 100, 0)

    [/autoit] [autoit][/autoit] [autoit]

    $iP1 = $iP2
    $iT1 = $iT2
    Return $iCPU
    EndFunc ;==>_ProcessGetCPU() by novaTek ...ver 0.11

    [/autoit]

    ...ist aber ungetestet - weiß nicht genau wegen JS...

    Grüsse!

  • Setz einfach bei _IELoadWait den Timeoutparameter runter. Standardmäßig ist der auf 5 Minuten.

    Andy hat mir ein Schnitzel gebacken aber da war ein Raupi drauf und bevor Oscar das Bugfixen konnte kam Alina und gab mir ein AspirinJunkie.