Page 1 of 1

What happens to eValid if two elements use the same ID tags

PostPosted: Mon Apr 06, 2015 12:51 pm
by Gabrila
Afternoon:

What happens if two elements have the same ID?

How can eValid distinguish the two elements?

Thanks

Re: What happens to eValid if two elements use the same ID t

PostPosted: Tue Apr 07, 2015 10:11 am
by eValid
Gabrila wrote:Afternoon:

What happens if two elements have the same ID?

How can eValid distinguish the two elements?

Thanks


Thanks for posting Gabrila,

You raise a very good point.

ID tags are supposed to be unique, but, guess what, they often are not.

And this non-uniqueness can befuddle the software test unless you do the right thing.

Clearly, this case calls for use of the structural testing features of eValid, described in summary here:

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

When you have TWO ID tags that have identical names, you will need to identify the first one, using a command sequence like this:

IndexSet 0
IndexFIndElement ID=non-unique-name

This always finds the first one on the page.

To find the second one you write:

IndexMove +1
IndexFIndElement ID=non-unique-name

First, the current sourceIndex is moved up one and then the search proceeds and when it finds the second instance of the non-unique-name'd ID tag eValid's sourceIndex will be pointing at the second one.

From there you can take any action you want.

Here are the resources available to you at this point:

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

-- eValid Support