Followers 0

# IE.au3

## 8 posts in this topic

Why doesn't au3 work?

I follwed directions :

Run with Beta.

But, it gives me the error :

Line 1458 (File "C:\Program Files\AutoIt3\beta\Include\IE.au3")

$o_object.fireEvent ("onchange")$o_object.fireEvent ("onchange")^ERROR

Error: The requested action with this object has failed.

##### Share on other sites

Why doesn't au3 work?

I follwed directions :

Run with Beta.

But, it gives me the error :

Line 1458 (File "C:\Program Files\AutoIt3\beta\Include\IE.au3")

$o_object.fireEvent ("onchange")$o_object.fireEvent ("onchange")^ERROR

Error: The requested action with this object has failed.

ie.au3 Is included in the latest Beta.

Reinstall Beta.

##### Share on other sites

ie.au3 Is included in the latest Beta.

Reinstall Beta.

I did... -__-

##### Share on other sites

#4 ·  Posted (edited)

ie.au3 Is included in the latest Beta.

Reinstall Beta.

Its cleary installed or else you don't get this error .... so why reinstall ? Edited by JdeB

Live for the present,
Dream of the future,
Learn from the past.

##### Share on other sites

I did... -__-

Can you post a scriptlet that shows the issue you have ?

Live for the present,
Dream of the future,
Learn from the past.

##### Share on other sites

#include <IE.au3>
#include <IE_V1Compatibility_T2.0_4.au3>

; Variables
$Username = ""$Password   =  ""
$Message = ""$TopicNumber = ""
$PostNumber = "" Dim$Thread[4]  = ["http://gaiaonline.com/forum/viewtopic.php?t=" & $TopicNumber,"http://www.gaiaonline.com/forum/posting.php?mode=edit&p=" &$PostNumber,"http://www.gaiaonline.com/forum/posting.php?mode=reply&tc=1&t=" & $TopicNumber,"http://www.gaiaonline.com/forum/posting.php?mode=reply&tc=561&t=" &$TopicNumber]
$Forum = "http://gaiaonline.com/forum/viewforum.php?f=23"$Main      =  "http://gaiaonline.com"
$Exit = 1$sid        =  ""
$sid2 = "" ;Hotkeys HotKeySet("^s", "Begin") HotKeySet("^e", "Stop") While$Exit = 1
Sleep(100)
WEnd

Func Begin()
If $Exit = 1 Then$Exit = 0
Global $IE = _IECreate("") Call("Prog") EndIf EndFunc Func Stop()$Exit = 1
Endfunc

Func Prog()
Call("Post")
EndFunc

_IENavigate($IE,"http://www.gaiaonline.com/gaia/login.php?")$Login = _IEFormGetObjByName($IE,"loginForm")$User = _IEFormElementGetObjByName($Login,"username")$Pass = _IEFormElementGetObjByName($Login,"password") _IEFormElementSetValue($User,$Username) _IEFormElementSetValue($Pass,$Password) _IEFormSubmit($Login)
$sid2 = _IEPropertyGet($IE,"locationurl")
$sid = "&" & StringMid($sid2,37, 9999)
EndFunc

Func Logout()
_IENavigate($IE,$Main)
_IELinkClickByText($IE,"Logout") EndFunc Func Post() While$Exit = 0
_IENavigate($IE,$Thread[2] & $sid)$Post = _IEFormGetObjByName($IE,"post")$Mess = _IEFormElementGetObjByName($Post,"message") _IEFormElementSetValue($Mess,$Message) _IEFormImageClick ($Post,"Submit","alt")
Sleep(50000)
_IENavigate($IE,$Thread[3] & $sid)$Post = _IEFormGetObjByName($IE,"post")$Mess = _IEFormElementGetObjByName($Post,"message") _IEFormElementSetValue($Mess,$Message) _IEFormImageClick ($Post,"Submit","alt")
Sleep(50000)
WEnd
EndFunc

It worked before I reinstalled windows.

##### Share on other sites

#include <IE.au3>
#include <IE_V1Compatibility_T2.0_4.au3>

; Variables
$Username = ""$Password   =  ""
$Message = ""$TopicNumber = ""
$PostNumber = "" Dim$Thread[4]  = ["http://gaiaonline.com/forum/viewtopic.php?t=" & $TopicNumber,"http://www.gaiaonline.com/forum/posting.php?mode=edit&p=" &$PostNumber,"http://www.gaiaonline.com/forum/posting.php?mode=reply&tc=1&t=" & $TopicNumber,"http://www.gaiaonline.com/forum/posting.php?mode=reply&tc=561&t=" &$TopicNumber]
$Forum = "http://gaiaonline.com/forum/viewforum.php?f=23"$Main      =  "http://gaiaonline.com"
$Exit = 1$sid        =  ""
$sid2 = "" ;Hotkeys HotKeySet("^s", "Begin") HotKeySet("^e", "Stop") While$Exit = 1
Sleep(100)
WEnd

Func Begin()
If $Exit = 1 Then$Exit = 0
Global $IE = _IECreate("") Call("Prog") EndIf EndFunc Func Stop()$Exit = 1
Endfunc

Func Prog()
Call("Post")
EndFunc

_IENavigate($IE,"http://www.gaiaonline.com/gaia/login.php?")$Login = _IEFormGetObjByName($IE,"loginForm")$User = _IEFormElementGetObjByName($Login,"username")$Pass = _IEFormElementGetObjByName($Login,"password") _IEFormElementSetValue($User,$Username) _IEFormElementSetValue($Pass,$Password) _IEFormSubmit($Login)
$sid2 = _IEPropertyGet($IE,"locationurl")
$sid = "&" & StringMid($sid2,37, 9999)
EndFunc

Func Logout()
_IENavigate($IE,$Main)
_IELinkClickByText($IE,"Logout") EndFunc Func Post() While$Exit = 0
_IENavigate($IE,$Thread[2] & $sid)$Post = _IEFormGetObjByName($IE,"post")$Mess = _IEFormElementGetObjByName($Post,"message") _IEFormElementSetValue($Mess,$Message) _IEFormImageClick ($Post,"Submit","alt")
Sleep(50000)
_IENavigate($IE,$Thread[3] & $sid)$Post = _IEFormGetObjByName($IE,"post")$Mess = _IEFormElementGetObjByName($Post,"message") _IEFormElementSetValue($Mess,$Message) _IEFormImageClick ($Post,"Submit","alt")
Sleep(50000)
WEnd
EndFunc

It worked before I reinstalled windows.

My apologies. I read it too fast and I thought that you were having problems with 'ie.au3' not 'IE_V1Compatibility_T2.0_4.au3.' Again.. My apologies.

##### Share on other sites

#8 ·  Posted (edited)

Several observations...

1) I see nothing in this code to require the use of the compatability module. It should make no difference if it is there or not

2) I cannot reproduce this because I do not have an account on this system. Can you find a way to reproduce it on a typical internet form?

3) This code line is in _IEFormElementSetValue -- you call it several times in your script. Please put some debug lines in your code to figure out which instance is causing the trouble (ConsoleWrite is a good command to learn to use when using SciTe)

4) Have you tried the _IEFormElementSetValue examples in the helpfile? Do they work for you?

4) the fireEvent logic is new to the latest versions of IE.au3 It is only beneficial if there is an onchange Javascript event routine on the element... if there is not, you can turn it off with a parameter to _IEFormElementSetValue with no impact. Without seeing the HTML code I have no way to help you here.

5) You can use _IEErrorHandlerRegister() to allow your script to continue past such errors (it generates a diagnostic message instead of aborting). I stringly recommend this, especially when developing or debugging scripts as you will be much more diagnostic information as well.

6) I don't expect IE.au3 to ever trap or anticipate every possible error condition because the user interaction with the browser to just too rich**. I have struggled with convenience functions like the onchange fireEvent as to whether it should be the default action ot not since they can sometimes cause trouble, but I have decided to leave it on as I think it will help more often than confuse.

Dale

** Edit: I want to be clear what I mean by "rich". By that I mean that there are so many ways to interact with the objects asynchronously and unpredictably. Objects that were available just the line before can be gone when you try to access them due to using browser buttons, clicking links or images, activating Javascript, closing the browser etc. Trapping for every such occurance is not feasible, which is whay I added the _IEErrorHandlerRegister in this release. I do try to acticipate as many common errors and situations as I can, but I will not get them all.

Edited by DaleHohm

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

Automate input type=file (Related)

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