Sign in to follow this  
Followers 0
GodandRock

_IEFormSubmit from IE.au3 UDF not working properly!

2 posts in this topic

#1 ·  Posted (edited)

Hey guys. I'm trying to automate sending an email through hotmail, but I'm having a problem. This is my script.

#include <IE.au3>

$helperemail = "youremail@yourdomain.com"
$helperpw = "yourpw"

 

$oIE = _IECreate("http://www.hotmail.com", 0)
$o_form = _IEFormGetObjByName($oIE, "f1")
$o_login = _IEFormElementGetObjByName($o_form, "login")
$o_password = _IEFormElementGetObjByName($o_form, "passwd")
_IEFormElementSetValue($o_login, $helperemail)
_IEFormElementSetValue($o_password, $helperpw)
_IEFormSubmit($o_form)
_IELinkClickByText($oIE, "New Message")

As you see, this script should log me in and click the "New Message" button. However, it does everything correctly, BUT it does not click the "New Message" button! Why is that? Please put in your own hotmail email and password in the variables to test.

But theres a twist...it DOES click the "New Message" button, but after a horribly long time. And Scite gives me the warning that _IELoadWait has timed out. According to my knowledge, the function _IEFormSubmit() is waiting for the page to finish loading before returning and its thinking that the page hasn't finished loading yet. But it really has! Then when it times out from waiting so long for the page to load, it skips and calls the next function, which is _IELinkClickByText()...Someone please find a way around this and fix this glitch! TY!

Edited by GodandRock

[font="Fixedsys"][size="3"][u][font="Franklin Gothic Medium"] [/font][/u][/size][/font]

Share this post


Link to post
Share on other sites



Here's the work around:

_IEFormSubmit($o_form, 0)
_IELoadWait($oIE)
_IELinkClickByText($oIE, "New Message")

There is an unexpected "Access Is Denied" COM error that has been discussed in other threads. I haven't decided the best way to deal with it yet -- thill then, use the workaround.

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