If you want to follow the example on the page more closely it would be like 
this for your html:

>> radio = b.label(:text=> 'Yes').parent.radio :value => '1'
=> #<Watir::Radio:0x10ece2890 located=false selector={:type=>"radio", 
:value=>"1", :tag_name=>"input"}>
>> radio.set
=> nil


On Monday, June 17, 2013 11:56:31 AM UTC-4, Fabian Arocena wrote:
>
> I thought b.radio was with watir, not watir-webdriver ...
> I'm just following the examples n the webpage
>
>
> On Mon, Jun 17, 2013 at 12:54 PM, Dan <dfr...@gmail.com <javascript:>>wrote:
>
>> I think you might be overcomplicating things, but if you want to work 
>> back up from the label you can do this:
>>
>> b.label(:text => 'Yes').parent.radio.set
>>
>> Otherwise you can just do this:
>> b.radio(:id => "Server_0").set
>> or
>> b.radio(:name => "Server").set
>>
>>
>>
>> On Monday, June 17, 2013 11:39:31 AM UTC-4, fabian....@gmail.com wrote:
>>>
>>> radio = browser.label(:for => 'Server_0').parent.radio.set
>>>
>>> radio = browser.label(:name => 'Server').parent.radio.set
>>>
>>> radio = browser.label(:text=> 'Server').parent.radio :value 'Yes'
>>>
>>> etc
>>>
>>> El lunes, 17 de junio de 2013 12:32:54 UTC-3, Dan escribió:
>>>>
>>>> Please show us the code that you tried.
>>>>
>>>> On Monday, June 17, 2013 11:26:19 AM UTC-4, fabian....@gmail.com wrote:
>>>>>
>>>>> Guys,
>>>>>
>>>>> I have this html :
>>>>>
>>>>> <input type="radio" name="Server" value="1" 
>>>>> onclick="displayHiddenText();**setPageChanged(true);" id="Server_0">
>>>>> <label for="Server_0">Yes</label>
>>>>>
>>>>> which would be the right ruby code with watir-webdriver to set the 
>>>>> radio button to Yes?
>>>>> I've tried the examples at:
>>>>>
>>>>> http://watirwebdriver.com/web-**elements/<http://watirwebdriver.com/web-elements/>
>>>>>
>>>>> but I'm not being able to locate the element...
>>>>>
>>>>> Thanks!
>>>>> Fabian
>>>>>
>>>>  -- 
>> -- 
>> Before posting, please read http://watir.com/support. In short: search 
>> before you ask, be nice.
>>  
>> watir-...@googlegroups.com <javascript:>
>> http://groups.google.com/group/watir-general
>> watir-genera...@googlegroups.com <javascript:>
>>  
>> --- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "Watir General" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/watir-general/3BHv_mq-d10/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> watir-genera...@googlegroups.com <javascript:>.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>
>

-- 
-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to