Page 1 of 1

How to know if an element is present in the page

PostPosted: Thu Feb 28, 2019 11:24 am
by RDrake
Morning.

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

Thanks

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

PostPosted: Fri Mar 01, 2019 2:44 pm
by eValid
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