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/ >>> >>> 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-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.