Harman, Elaine wrote:
Looks like there's a bug in PageBot.locateElementByName, when
retrieving a form array element. e.g.: <input type="radio"
name="radioArray" value="one"> Option #1 <input type="radio"
name="radioArray" value="two"> Option #2
This is not exactly a bug - more a limitation of the design. At the
moment, element locators are expected to return only a single element.
This works nicely for most cases, but as you've found, it makes it
trickier to deal with groups of radio-buttons or checkboxes.
This change makes sense to me, but I can also see how it might be
dodgy to have locateElementByName sometimes return an element and
sometimes an array.
Unfortunately, yes, I think it's overly dodgy.
I have a cunning plan. How about we overload the check and uncheck
commands to support two different calling styles?
(1) check <LOCATOR>
(2) check <NAME> <SELECTOR>
In (1) the argument is expected to be a normal locator, returning a
single element. Only DOM or XPath locators would make sense, really.
In (2), with a second SELECTOR argument, we can assume that the first
argument is a NAME, not a locator (doesn't make sense otherwise). So
we'd use something like PageBot.locateAllElementsByName(NAME) instead of
findElement(NAME).
Do you reckon that would work?
--
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