exploitz Posted September 8, 2010 Share Posted September 8, 2010 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 More sharing options...
JohnOne Posted September 9, 2010 Share Posted September 9, 2010 (edited) 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 September 9, 2010 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 More sharing options...
DaleHohm Posted September 9, 2010 Share Posted September 9, 2010 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 More sharing options...
exploitz Posted September 9, 2010 Author Share Posted September 9, 2010 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.DaleI will try looking for an element on the page. That is a great idea, thanks. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now