Jump to content

Detecting whether an object/element has loaded


Athos
 Share

Recommended Posts

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.

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

Are we supposed to do this all with IEPropertyGet?

Edited by Athos
Link to comment
Share on other sites

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.
Link to comment
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]
Link to comment
Share on other sites

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.
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...