Trying to select radio button with Watir

796 views Asked by At

I am trying to select a radio button which i have done on other pages but cant seem to get this one to work

Here is the html for the radio button I am trying to access:

<fieldset id="category_fieldset">

<div class="group category first">
    <label class="label"></label>
    <div id="category_options">
        <div class="toggle-btn">
            <input id="category_rental" type="radio" value="rental" name="fields[category]"></input>
            <label for="category_rental">
                <span></span>
                For Rent
            </label>

Here are the --- i have made (none of these have worked)

browser.radio(:name => "fields[category]").set

browser.radio(:id => "category_rental").click

browser.radio(:value => "rental").click
1

There are 1 answers

0
user1902953 On

thanks for the feedback on this

i tried this and seems to work

browser.label(:text => "For Rent").click