[EMAIL PROTECTED] wrote on 06/11/2005 12:01:03 AM:
> Therefore, I think we need to find a way to identify a toggle-button
> within a name-group, using a secondary attribute; typically 'value'. My
> first thought was that this could be done via a second, optional
> argument to the toggle-button commands:
>
> check( locator, selector )
>
> e.g.
>
> | check | options | cheese |
>
> Having started down that road, I'm now wondering whether it mightn't be
> better to simply extend the "name=" locator itself to support an
> optional "element selector" suffix, e.g.
>
> | check | options cheese | |
>
> Primarily, it's because I think it would be cleaner to implement that
> way, and the result would be more general, as the extended "name="
> locator could be useful for other commands, too, e.g.
>
> | verifyVisible | options cheese | |
>
> Also, I think an "element selector" is really only useful in conjunction
> with name-based element addressing, anyway; there's no need of it for
> id, dom or xpath locators.
>
> Any one have an opinion? Is matching the toggle-button value in the
> locator a bad move?
>
> As an aside, I'm thinking of the "element selectors" as a generalisation
> of the existing "option specifiers" that are used in handling of
> <select> elements.
>
First, thanks for the new commands!
I like the idea of extending the locator. A big problem with the current "option specifiers" for <select> elements is that they will be difficult to generalize to "store" commands and "waitFor" commands.
Things to consider:
Should you be able to capture the state of a single check box with:
| storeChecked | options cheese | myVariable |
Can you then use that variable later to set the checked status of another check box:
| check | options onions | ${myVariable} |
With the <select> element, I have found it useful to be able to select an option by it's index, id, value, or text content. It would not surprise me if some of these might also be useful for check boxes (and radio buttons maybe???)
e.g. To check the first checkbox in the list, simply use:
| check | options index=1 |
To store whether or not the fist check box is checked, use:
| storeChecked | options index=1 | myVariable |
Cheers,
David
David Kemp
ThoughtWorks Australia Pty Ltd
http://www.thoughtworks.com
_______________________________________________ Selenium-devel mailing list Selenium-devel@lists.public.thoughtworks.org http://lists.public.thoughtworks.org/mailman/listinfo/selenium-devel