CaptainBeardsEyesBeard Posted January 28, 2020 Share Posted January 28, 2020 Hi 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 Sleep(10000) ConsoleWrite(@CRLF & "Getting handle") $hWnd = WinGetHandle($ApplicationWindow) Sleep(5000) ConsoleWrite(@CRLF & "Activating Window") WinActivate($ApplicationWindow) $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) EndIf if WinSetState($ApplicationWindow, "", @SW_MAXIMIZE) Then Else Sleep(6000) WinSetState($ApplicationWindow, "", @SW_MAXIMIZE) EndIf Link to comment Share on other sites More sharing options...
Nine Posted January 28, 2020 Share Posted January 28, 2020 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... “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy 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