Jump to content

Opening an IE page suddenly hanging

Recommended Posts


My automation has suddenly started hanging. Is there anything wrong I'm doing?


Here's the console output and it's literally been hanging for 30 minutes (and it hangs at this point each time) 

>"C:\Program Files (x86)\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "H:\Quality Assurance\AutoIT Scripts\EliteClientInceptionAutomation\Framework\TestEnv.au3"    

Loading URL --> IE.au3 T3.0-2 Warning from function _IEAttach, $_IESTATUS_NoMatch

Here's the code

ConsoleWrite(@CRLF & "Loading URL ")

Local $oIE = _IECreate($URL, 1)
WinWait($ApplicationWindow, 10)
ConsoleWrite(@CRLF & "Waiting for window")

;attach ie window
ConsoleWrite(@CRLF & "Getting handle")

$hWnd = WinGetHandle($ApplicationWindow)

ConsoleWrite(@CRLF & "Activating Window")
$oIE = _IEAttach($hWnd, "hwnd")
ConsoleWrite(@CRLF & "Attaching IEATTach for window")

if @error then
   ConsoleWrite("Unable to attach IE window")
   MsgBox($MB_SYSTEMMODAL, "Error handling  ", "Can't attach IE Window ", 4)


   if WinSetState($ApplicationWindow, "", @SW_MAXIMIZE) Then

   WinSetState($ApplicationWindow, "", @SW_MAXIMIZE)


Link to post
Share on other sites

Your if @error then is wrongly placed.  The consoleWrite statement before removed the @error value coming from _IEAttach. While you are at it, you should console the value of $hWnd...

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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...