#1415 closed Bug (No Bug)
Issue with IE & HWnd($o_object.HWnd()) ERROR
| Reported by: | Steveiwonder | Owned by: | |
|---|---|---|---|
| Milestone: | Component: | AutoIt | |
| Version: | 3.3.2.0 | Severity: | None |
| Keywords: | Cc: |
Description
This is the error I'm getting it worked once... i tested it again (with no change to code) and got this this:
C:\Program Files\AutoIt3\Include\IE.au3 (3116) : ==> The requested action with this object has failed.: Return HWnd($o_object.HWnd()) Return HWnd($o_object.HWnd()^ ERROR >Exit code: 1 Time: 0.554
I did a search on the forum and came across this post.
http://www.autoitscript.com/forum/index.php?showtopic=97549
After the first guy saying "A reboot" fixed it i did the same and sure enough, it was fine.
Although the conclution of the problem was suggested to be a windows error and no AutoIt - I was wondering IF is it auto it causing the problem in the first place?
I am sorry if i'm wrong just though i would point it out incase its a bug that you would like to fix.
Again it may just be a Windows issue.
I'm using:
IE8 (All Updates installed)
Windows XP Pro SP3.
Thanks for your time.
HERE IS MY SCRIPT:
#include <IE.au3>
Local $WinTitle = "Case Untitled -"
Local $WinHandle
Local $oIE
Local $StringToFind = "<TEXTAREA"
Local $CasePage = False
Local $i = 0
#cs
Questions for new ticket
#ce
Local $Q
Local $Questions[7]
$Questions[0] = "When did issue start?"
$Questions[1] = "Downtime available?"
$Questions[2] = "Site Access?"
$Questions[3] = "On Site Contact?"
$Questions[4] = "Has equitment been checked/rebooted?"
$Questions[5] = "VLAN/VC (Ethersphere Only)?"
$Questions[6] = "How many errors? or how many times has circuit dropped (If Applicable)?"
#cs
End of Questions
#ce
While 1 = 1
ConsoleWrite("Waiting for new window" & @CRLF)
WaitforWindow()
Questions()
WinWaitClose($WinTitle)
ConsoleWrite("Window Closed" & @CRLF)
Wend
Func Questions()
sleep(1000)
WinActivate($WinTitle)
WinWaitActive($WinTitle)
BlockInput(1)
Opt("MouseCoordMode", 0)
MouseClickDrag("Left", "220", "165", "137", "165", "0")
Send("{CTRLDOWN}c{CTRLUP}")
MouseClick("Left", "235", "250", "1", "0")
Send("{CTRLDOWN}v{CTRLUP}")
For $Question in $Questions
$Q = $Q & $Question & @CRLF
Next
MouseClick("Left", "537", "195", "1", "0")
sleep(100)
MouseClick("Left", "565", "343", "1", "0")
sleep(100)
MouseClick("Left", "694", "160", "1", "0")
sleep(100)
MouseClick("Left", "100", "620", "1", "0")
Opt("MouseCoordMode", 1)
ClipPut($Q)
Send("{CTRLDOWN}v{CTRLUP}")
BlockInput(0)
EndFunc
Func WaitforWindow()
WinWait($WinTitle)
ConsoleWrite("Wait Finished! Window Showed up!" & @CRLF)
If WinExists($WinTitle) Then
$WinHandle = WinGetHandle($WinTitle)
$oIE = _IEAttach($WinHandle, "HWND")
ConsoleWrite("Winhandle Found, Attach Complete" & @CRLF)
While $CasePage = False
If WinExists("Case Untitled:Flash! -") Then
WinSetState("Case Untitled:Flash! -","",@SW_MINIMIZE)
EndIf
If WinExists($WinTitle) Then ;FailSafe - If Someoene closes the window while it is continuously reading the HTML then it will exit.
_IELoadWait($oIE); Wait for Load
ConsoleWrite("Load Complete" & @CRLF)
$html = _IEBodyReadHTML($oIE) ; Read HTML
If StringInStr($html, $StringToFind) Then ; HTML contains the correct string? The right page is now visible!
$CasePage = True
ConsoleWrite("New Case Window Open!" & @CRLF)
Return 1
EndIf
Else
Return 0 ; Window was closed before it found the HTML inside the corrrect window.
EndIf
sleep(15000)
WEnd
EndIf
EndFunc
Attachments (0)
Change History (6)
comment:1 follow-up: ↓ 2 Changed 16 years ago by Steveiwonder
comment:2 in reply to: ↑ 1 Changed 16 years ago by Valik
- Resolution set to No Bug
- Status changed from new to closed
Replying to Steveiwonder:
Ignore the noob script with all mouselclick spam etc , i still need to change some of that.
Done. Now go read WikiStart.
comment:3 Changed 16 years ago by anonymous
This is a AI bug or Windows? or just Unknown. Sorry for the code paste inline.
comment:4 Changed 16 years ago by Valik
I don't particularly care. The script is way too long and I'm not wasting time trying to track down some maybe-bug in a script that large. Maybe if you provide a shorter script that demonstrates the problem I'll bother to look. However, the forum is better suited for the discussion since you don't even know if there's a bug here. Until you can reliably reproduce something and accurately describe what's happening then you should not be posting on the issue tracker.
comment:5 Changed 16 years ago by anonymous
Point taken. I can't replicate the bug when need too, it appears to be random.
Sorry for that.
comment:6 Changed 14 years ago by Samoth
It actually is a bug... And I know a workaround.
See this post and its previous posts for error tracking. There's good work done over there.
Guidelines for posting comments:
- You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
- In-depth discussions should take place on the forum.
For more information see the full version of the ticket guidelines here.

Ignore the noob script with all mouselclick spam etc , i still need to change some of that.