Harman, Elaine wrote:
Apologies in advance for the long, dull novel.
No problem. Thanks for taking the time.
At present, everything that uses an element-locator expects the return
value to be, well, an element. I don't think we wanna have to check in
each case whether it is in fact an element, or an array.
Yes, document.elements[] can return either a single element, or an array
... IMHO, that's a bad design, as it forces users of the API to check
the return-type. And don't buy that we should relax the principles of
good design just 'cos it's a browser environment. Sorry.
In fact that locateElementByDomTraversal() may sometimes return an array
is a problem: maybe we should ensure that it returns only a single
element. Actually, as it stands, it could return just about anything,
ie. a String, or a Number, etc. In other words, use "dom=" carefully.
There's an argument for making element locators return an array in all
cases, but then you'd kinda expect things like "xpath=//[EMAIL PROTECTED]'foo']"
to keep searching the document for *all* matches, which would be
wasteful when in 99% of cases we'd just want the first one.
--
cheers, MikeW http://www.dogbiscuit.org/mdub/
_______________________________________________
Selenium-devel mailing list
Selenium-devel@lists.public.thoughtworks.org
http://lists.public.thoughtworks.org/mailman/listinfo/selenium-devel