Jump to content

_IELoadWait()


exploitz
 Share

Recommended Posts

Hi again..

So I'm writing an application that needs to paste some information into a box on the page, however _IELoadWait() seems to fire too early, and the paste then fails.

I really need an alternative way to check if the page has loaded, or maybe I am implementing loadwait incorrectly?

Func replyEmail() ;Replies to the selected email
    setStatus("Replying to email")
    setClip()
    attach("Outlook")
    $oReply = _IEGetObjById($oIE, "replycombo")
    _IEAction($oReply, "click")
    WinActivate("RE")
    WinWaitActive("RE")
    attach("RE")
    _IELoadWait($oIE)
    _IELoadWait($oIE)
    _IELoadWait($oIE)
    _IELoadWait($oIE)
    Sleep(1500)
    Send("^v", 0)
    Sleep(900)
    Send("{LEFT}", 0)
    Send("{ENTER}", 0)
    setStatus("IDLE")
EndFunc   ;==>replyEmail

Notice I put more than one loadwait to see if it will catch it.. however i still get the issue sometimes.

Link to comment
Share on other sites

Heres what I have done in the past.

Use this to test my webpage a few times, to assess how many times it returns before visually loaded in browser.

#include <IE.au3>
$oIE = _IECreate("www.somesite.com")
$i = 1
While 1
    If _IELoadWait($oIE) Then
        ConsoleWrite($i & @LF)
        $i += 1
    EndIf
WEnd

So lets assume it loads 4 times

#include <IE.au3>
$oIE = _IECreate("www.somesite.com")
For $i = 1 To 4
    _IELoadWait($oIE)
Next
MsgBox(0,"","Loaded")

Im certain its not the greatest way, but has worked for me.

Edited by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

It isn't clear to me what line in your code is failing. What i would suggest however is insuring that you can get a reference to the element you want to fill before trying to do so or looking for another element on the page that only appears after the final load is done. With Server-side redirects, META Refresh and Ajax in play, there may not be a general way to insure the page has loaded to the stopping point you desire.

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

It isn't clear to me what line in your code is failing. What i would suggest however is insuring that you can get a reference to the element you want to fill before trying to do so or looking for another element on the page that only appears after the final load is done. With Server-side redirects, META Refresh and Ajax in play, there may not be a general way to insure the page has loaded to the stopping point you desire.

Dale

I will try looking for an element on the page. That is a great idea, thanks.

Link to comment
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
 Share

  • Recently Browsing   0 members

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