Page 1 of 1

Issues with a property name not unique on the page

PostPosted: Mon Feb 24, 2020 10:19 am
by SheilaL
Hello.

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

What do you recommend?

Thanks

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

PostPosted: Tue Feb 25, 2020 12:24 pm
by eValid
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