Need to test an drop down list

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

Need to test an drop down list

Postby AngieD » Wed Nov 18, 2015 3:53 pm

Hi.

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

Thanks
AngieD
 
Posts: 1
Joined: Wed Nov 18, 2015 3:49 pm

Re: Need to test an drop down list

Postby eValid » Thu Nov 19, 2015 4:20 pm

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
eValid
 
Posts: 1832
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