Jump to content
Sign in to follow this  
Valuater

IE Object ready-state problem

Recommended Posts

Valuater

I am using IE to automate a web page. When the page is scanning, the button I am after does not show (visible) until the scan is complete. However, it is found in the source.

If IsObj($button4) Then

MsgBox(0,0, "is an object button 4 ") ; **** this works

MsgBox(0,0, _IEPropertyGet ($button4, "readystate"))

EndIf

error...

IE.au3 V2.4-0 Error from function _IEPropertyGet, $_IEStatus_InvalidObjectType

is there another way to wait until the button is "visible" or not "disabled"

Thanks

Valuater

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
Valuater

If IsObj($button4) Then

MsgBox(0,0, "is object button 4 ")

_IEAction ( $button4, "visible")

EndIf

error...

IE.au3 V2.4-0 Error from function _IEAction, $_IEStatus_InvalidObjectType

hmm..???

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
Authenticity

Applies To:

document, FRAME, IFRAME, IMG, INPUT type=button, INPUT type=checkbox, INPUT type=file, INPUT type=hidden, INPUT type=image, INPUT type=password, INPUT type=radio, INPUT type=reset, INPUT type=submit, INPUT type=text, LINK, SCRIPT, TABLE, TBODY, TD, TFOOT, TH, THEAD, TR, Element Constructor, HTMLDocument Constructor

Yup, it's supposed to return "Complete" if the button is ready assuming it's strictly an input element and not javascript's makeup.

#include <IE.au3>

Dim $o_IE = _IECreate('http://www.google.com/')
Dim $oElem = _IEGetObjByName($o_IE, 'btnG')
ConsoleWrite($oElem.ReadyState & @LF)

Share this post


Link to post
Share on other sites
DaleHohm

Visibility is not tied to readyState.

visible or disabled is an element attribute. If you show the button HTML before and after I could give you precise way to test. Without that, I can suggest that you use StringInStr on the result of _IEPropertyGet($button4, "outerhtml")

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
Valuater

Thanks guys!!

If you show the button HTML before and after I could give you precise way to test.

If I knew the HTML after I would know enough to do what I need. I am actually not going to push the button, it's just a way to tell that the page is finished.

I will test with your suggestion dale

Thanks

Valuater

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
Valuater

Thanks Dale, that worked a treat!!

If StringInStr(_IEPropertyGet($button4, "outerhtml"), "inline") Then

8)


NEWHeader1.png

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.