How to know if an element is present in the page

Applying eValid to AJAX applications that require advanced DOM-based methods.

How to know if an element is present in the page

Postby RDrake » Thu Feb 28, 2019 11:24 am

Morning.

Is there any method that I can use to find out if that page that has a particular element is present?

Thanks
RDrake
 
Posts: 2
Joined: Thu Feb 28, 2019 11:19 am

Re: How to know if an element is present in the page

Postby eValid » Fri Mar 01, 2019 2:44 pm

RDrake wrote:Morning.

Is there any method that I can use to find out if that page that has a particular element is present?

Thanks


Thanks for posting RDrake.

This happens a lot when testing AJAX applications.

You need to pivot a test, or synchronize a playback, on a particular element having a particular value, and at one point that element might not yet have been populated to that particular value.

The key to remember is that the contents of the DOM changes over time in complex AJAX applications.

In eValid, the facts you can search for are a particular index value (what is called "sourceIndex" in eValid) and the name and expected value of a particular property at that element.

If it turns out that the current page at that particular element has a property of the right name and that property has the right value, then you have verified that fact.

(What it means if that is NOT the page you expect, that is, that you have a coincidently "hit", is another questions.)

If you haven't deduced this yet, your question is the same as trying to synchronize playback on a [dynamically changing] DOM value.

This kind of thing is handled in eValid with the "SyncOn.." and "SyncNotOn..." commands, describe here:

http://e-valid.com/Products/Documentati ... mmary.html

Let us know if you need more information?


-- eValid Support
eValid
 
Posts: 1918
Joined: Tue Jan 01, 2008 12:48 pm
Location: USA


Return to AJAX Applications & DOM Processing

Design Downloaded from free phpBB templates | free website templates | Free Web Buttons