Thursday, 15 March 2012

ruby - Using Watir-Webdriver to select radio button -



ruby - Using Watir-Webdriver to select radio button -

i trying automate survey , far until came radio buttons assumed easy can't them right.

the html code this:

<span class="radiobuttonholder"> <span class="radiobranded" style="background-position: 0px -1px;"></span> <input id="a.1" class="customctrllarge" type="radio" value="1" name="a"></input>

with watir-webdriver tried:

browser.radio(:name => 'a', :value => '1').click

this hasn't worked. have tried:

browser.radio(:id => 'a.1').click browser.find_element(:name => 'a', :value => '1').click

i've run similar problems on site test, in order front-end developer 'stylize' radio buttons 'covers' them 'span' element. making 'actual' radio element unclickable. around 'click' on 'span' element, sets radio selection.

i'm assuming tried 'set' radio button?

browser.radio(:name => 'a', :value => '1').set

ruby webdriver watir watir-webdriver

No comments:

Post a Comment