简体   繁体   中英

Setting Radio button using Ruby and Watir

Right i am having issues with a section of code. I know how to set radio buttons i can do it on most websites. But when trying to set a value given by this code below i cannot make it work. I have tried "waiting until", "parent setting" using the label ect and searched through all sorts. Could any one point me in the right direction.

<div class="CheckBoxContainer">

<ol>
    <li>
        <span class="radio" style="background-position: 0px 0px;"></span>
        <input class="styled" type="radio" value="1" name="clocksource"></input>
        <label class="dialogRT">

            Internal

        </label>
    </li>
    <li>
        <span class="radio" style="background-position: 0px 0px;"></span>
        <input class="styled" type="radio" value="3" name="clocksource"></input>
        <label class="dialogRT">

            External AES50

        </label>
    </li>
    <li>
        <span class="radio" style="background-position: 0px -50px;"></span>
        <input class="styled" type="radio" checked="checked" value="2"       name="clocksource"></input>
        <label class="dialogRT">

            External Snake

        </label>
    </li>
</ol>

I get this error :

[remote server] file:///var/folders/81/j_87g_h12_x7bkl2w58zwqr00000gn/T/webdriver-profile20131024-1211-10eh16l/extensions/fxdriver@googlecode.com/components/command_processor.js:8210:in `fxdriver.preconditions.visible': Element is not currently visible and so may not be interacted with 

Thanks

Maximillion

I suspect you have a timing issue. Try this:

Watir::Wait.until { @browser.element.visible?, thing  }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM