Sign in to follow this  
Followers 0
darkmaster071

_IELoadWait() fails if there are more tabs

4 posts in this topic

#1 ·  Posted (edited)

I have more tabs opened in IE8 and _IELoadWait() starts to fail to wait on tabs, even if they are currently focused. Anyone can think of a reason why this happens and how to fix it (or maybe im the only one experiencing this?) Thanks.

Edited by darkmaster071

Share this post


Link to post
Share on other sites



How do you use _IEAttach and _IEloadwait ?

Post your code

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

I stripped down my code, showing you the thing that doesnt work. I want it to click through 5 links and wait for them to load, so i can continue with my code. If the tabs arent fully loaded my script could fail. So... Why doesnt _IELoadWait($IEvar) wait for opened tabs to load? I am seeing it cycle through the clicks, but tabs open over eachother when they are not loaded yet.

#Include <IE.au3>

$IEvar=_IECreate("www.url.com", 1, 1, 1, 1)

$imagesclicked=1
While $imagesclicked<6
    Switch $imagesclicked
        Case 1
            _IEImgClick($IEvar, "image1.gif")
            Sleep(500)  ;just in case...
            _IELoadWait($IEvar)
            
        Case 2
            _IEImgClick($IEvar, "image2.gif")
            Sleep(500)
            _IELoadWait($IEvar)
            
        Case 3
            _IEImgClick($IEvar, "image3.gif")
            Sleep(500)
            _IELoadWait($IEvar)
            
        Case 4
            _IEImgClick($IEvar, "image4.gif")
            Sleep(500)
            _IELoadWait($IEvar)
            
        Case 5
            _IEImgClick($IEvar, "image5.gif")
            Sleep(500)
            _IELoadWait($IEvar)
    EndSwitch
    
    $imagesclicked=$imagesclicked+1
WEnd
Edited by darkmaster071

Share this post


Link to post
Share on other sites

$IEvar is always pointing to your original IE window. What made you think it would magically point to the IE instance in the new tab?

You need to use _IEAttach to get a reference to the new tabbed IE instance and then you can use _IELoadWait on it.

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

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  
Followers 0