Jump to content

IE.au3


Recommended Posts

Please post what you tried using to do this and we'll see what we can do to help. There are several Inbox links...

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

Link to comment
Share on other sites

[From other links ;]

Hi,

I don't know if Dale has a "com" answer (so far that page is in a frame not reading from Dale's UDFs, I think); and I don't know how to do it in AutoIT.

The workaround (post it if you know the syntax please!) is:

1. Wait till control text in status bar says "Opening page", then wait till it says "Done" [or any other way you know to check the page is fully loaded].

2. Send "control-F", wait for find window, to find "My Messages"; "enter"

3 escape the find window.

4. send "shift-tab" (highlights that Link)

5. send "spacebar"

Best, Randall

Link to comment
Share on other sites

Actually, if you use the previous script to login to Hotmail, it will take you to the "Today" page...

The following two lines will click on the Mail tab and then the Inbox:

_IEClickLinkByText($oIE,"Mail")
_IEClickLinkByText($oIE,"Inbox")

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

Link to comment
Share on other sites

Actually, if you use the previous script to login to Hotmail, it will take you to the "Today" page...

The following two lines will click on the Mail tab and then the Inbox:

_IEClickLinkByText($oIE,"Mail")
_IEClickLinkByText($oIE,"Inbox")

<{POST_SNAPBACK}>

That's great! - but still needs a "sleep(30000)" (30secs) wait for me; is there a way to tell when to send the textclicks?

Randall

Link to comment
Share on other sites

I'm not sure why... I built in an _IELoadWait() by default into the _IEFormSubmit and the _IEClickLinkByxxx so it should wait for the load to complete before mving to the next command.

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

Link to comment
Share on other sites

Hi, Dale,

Have you tried it also to confirm it isn't just me?

It is also the case for the other sites, as the time always shows for the end of the macro in the console way before any of those sites have finally loaded?

Best, Randall

Link to comment
Share on other sites

Right. It is there in the _IEClickLinkxxx functions but not the _IEFormSubmit (because FormSubmit uses a form object instead of the top level window, so the ReadyState property doesn't apply).

I believe that all of the functions that I built the LoadWait into have an optional $f_wait parameter where you can turn it off and make it asynchronous. For those functions there it isn't being done automatically, you need to call it yourself, i.e.

_IEFormSubmit($oForm)
_IELoadWait($oIE)

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

Link to comment
Share on other sites

Hi,

Here' my mixed COM/ wait workaround; the "sleep"s may vary on your situation; thanks again to Dale.

#include <IE.au3>

dim $x

AutoItSetOption("WinTitleMatchMode", 2)

; Create a browser window and navigate to hotmail

$oIE = _IECreate()

_IENavigate($oIE, "http://www.hotmail.com")

;_IENavigate($oIE, "http://login.passport.net")

; get pointers to the login form and username and password fields

$o_form = _IEFormGetObjByName($oIE, "f1")

$o_login = _IEFormElementGetObjByName($o_form, "login")

$o_password = _IEFormElementGetObjByName($o_form, "passwd")

; Set field values and submit the form

_IEFormElementSetValue($o_login, "USER@hotmail.com")

_IEFormElementSetValue($o_password, "Password")

_IEFormSubmit($o_form)

while not StringInStr($x,"Opening")

sleep(20)

$x = StatusbarGetText("Internet Explorer")

wend

while not StringInStr($x,"Done")

sleep(20)

$x = StatusbarGetText("Internet Explorer")

wend

_IEClickLinkByText($oIE,"Mail")

;_IEClickLinkByText($oIE,"Inbox")

Exit

Best, Randall Edited by randallc
Link to comment
Share on other sites

Right.  It is there in the _IEClickLinkxxx functions but not the _IEFormSubmit (because FormSubmit uses a form object instead of the top level window, so the ReadyState property doesn't apply).

I believe that all of the functions that I built the LoadWait into have an optional $f_wait parameter where you can turn it off and make it asynchronous.  For those functions there it isn't being done automatically, you need to call it yourself, i.e.

_IEFormSubmit($oForm)
_IELoadWait($oIE)

Dale

<{POST_SNAPBACK}>

It still doesn't work. I need to make a Sleep function to send the click :)
Link to comment
Share on other sites

Right, what is happening is that the click is being sent and the readystate is being checked by the next AutoIt command before it has a chance to change as a result of the click.

I'm going to add a configurable delay into the LoadWait in the next release, but in the mean time, try adding a Sleep(500) after the submit.

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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...