On Wed, Nov 12, 2008 at 7:20 AM, TCBlues <[EMAIL PROTECTED]> wrote:

> How could I get all the possible values of a radio button?
> For example if I  have something like:
>  <input type="radio" name="email_frequency" value="daily">Daily Email</
> input>
>  <input type="radio" name="email_frequency" value="weekly">Weekly
> Email</input>
>  <input type="radio" name="email_frequency" value="monthly">Monthly
> Email</input>
> How could I get all the possible values: daily, weekly and monthly
you are going to have to wait until we build the radio_group in Watirloo
but in the meantime I use this helper method for radio groups and for
checkbox groups

  def get_values_by_name(name)
    value_list = []
    @browser.document.getElementsByName(name).each do |el|
      value_list << el.attributes('value').value
    return value_list

in your example

# => ['daily', 'weekly', 'monthly']

and page object is the semantic wrapper in Watirloo that provides @browser

if you don't want to bother with Page class then use the guts of the method

marekj | i can has watir framework
Semantic Page Objects Modeling in Watir

You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 

Reply via email to