Page 1 of 1

Need to test an drop down list

PostPosted: Wed Nov 18, 2015 3:53 pm
by AngieD
Hi.

Is there any way to test if a drop down list box by mistake has two instances of the same named element?

Thanks

Re: Need to test an drop down list

PostPosted: Thu Nov 19, 2015 4:20 pm
by eValid
AngieD wrote:Hi.

Is there any way to test if a drop down list box by mistake has two instances of the same named element?

Thanks


Thanks for posting.

Good question.

The answer, fortunately, is pretty simple.

First, set the current index pointer to the top of the page:

SetIndex 0

Find the element by searching for the name (we assume you know that) using the IndexFindElement command, described here:

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

When this command finds the named element (by its property name or the combination of a property name and property value), it will leave the pointer at the position where it found it.

Then, advance the pointer one element down:

IndexMove +1

Now, run the same find command again AGAIN and if it finds the name it will be the second one on the page.

Otherwise (there'll be an error flag set) it isn't there.

-- eValid Support