Issues with a property name not unique on the page

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

Issues with a property name not unique on the page

Postby SheilaL » Mon Feb 24, 2020 10:19 am

Hello.

What happens when a property name is not unique on the page?

What do you recommend?

Thanks
SheilaL
 
Posts: 1
Joined: Mon Feb 24, 2020 10:07 am

Re: Issues with a property name not unique on the page

Postby eValid » Tue Feb 25, 2020 12:24 pm

SheilaL wrote:Hello.

What happens when a property name is not unique on the page?

What do you recommend?

Thanks


Thanks for posting your question SheilaL.

Indeed, these days nearly anything is possible in the DOM, considering how many different applications make modifications.

The chance of two different modifications producing identical properties and property values is certainly there.

First, this question only makes sense if the DOM of the page is stable; if it is being updated then you probably should wait, if you can, for it to stabilize.

The key eValid command here is "IndexFindElement" as detailed here:

http://www.e-valid.com/Products/Documen ... ement.html

This identifies a "sourceIndex" [an eValid internal value] that matches something.

The way it works is that is starts at the current value of sourceIndex (which defaults to 0) and finds the NEXT element that matches the criteria.

So, given that there are two (or more) property names that have the same property value they will be arranged in the DOM in increasing order.

If you want the second one, for example, you run the search command, increment "sourceIndex" and run the command again:

IndexSet 0
IndexFindElement "Something"
IndexMove 1
IndexFindElement "Something"

Actually, that first "IndexSet 0" isn't needed if this is the FIRST time you run a search, but it's included here for 100% clarity.


-- eValid Support
eValid
 
Posts: 2035
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