Sign in to follow this  
Followers 0
Athos

Detecting whether an object/element has loaded

10 posts in this topic

Hi guys. I'm having difficulty trying to detect if an object is loaded.

So basically, I want to imitated the _IELoadWait() Method, but instead, I want to wait until a particular object appears on the screen. In the past I was able to do this by looking for a particular link, but with this current webpage, all I have access to are 2 objects.

<INPUT TYPE="button" NAME="a_button" VALUE="I accept">  <INPUT TYPE="button" NAME="b_button" VALUE="I don't accept">

So I need to wait until either of these buttons is clickable, but I'm really not sure how. There doesn't appear to be a collection for objects. There is a form element one, but these objects don't have a form that I can reference.

Share this post


Link to post
Share on other sites



Get the attributes of the object when disabled, and enabled, and then perform a loop, looking specifically for the node to include the enabled attribute.


IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Get the attributes of the object when disabled, and enabled, and then perform a loop, looking specifically for the node to include the enabled attribute.

Are we supposed to do this all with IEPropertyGet?

Edited by Athos

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Use IE Developer Tools to view the html source of the given object, in both states (though, more importantly when active).

Then use the _IE* functions to zero in on it.

good place to start:

http://www.w3schools.com/htmldom/dom_methods.asp

Edited by jdelaney

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

I don't get what it means when _IEPropertyGet($agreeB, "isdisabled)=0. It fails, so does that mean its enabled? If so then, why can't I click it right away??

Edited by Athos

Share this post


Link to post
Share on other sites

Also I can see the source of the given object, it's just I don't think there are any attributes to manipulate.

Share this post


Link to post
Share on other sites

We need more specifics here.

When the page finishes loading, are these items also loaded with the page?

(i.e. Are they loaded normally or via ajax)

Are you waiting for the objects to load/exist or are you waiting for them to become 'enabled' from a 'disabled' state?


[font="Impact"] I always thought dogs laid eggs, and I learned something today. [/font]

Share this post


Link to post
Share on other sites

ame1011, I am waiting for the objects to laod/exist.

These objects do load with the page, my problem is waiting until they are in fact loaded.

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

Create your own UDF, that uses the given _IE* functions, that performs a loop until found, or fails

something like WaitForIEElement ( $oIE, $ID, $iMaxWaitTime, $iChecks )

Edited by jdelaney

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

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