如何使用ruby capybara选择隐藏的单选按钮

时间:2016-06-29 09:44:45

标签: ruby selenium capybara

<tr>
<td>
    <div align="right">
        <font size="2" face="Arial, Helvetica, sans-serif" color="red"/>
        <font size="2" face="Arial, Helvetica, sans-serif" color="#004891">Material type :</font>
    </div>
</td>
<td>
    <input type="radio" onclick="radioInsert='01'" name="rdInsertType"/>
    <font size="2" face="Arial, Helvetica, sans-serif" color="#004891">
        Promotion                                                                                                                
        <input type="radio" onclick="radioInsert='02'" name="rdInsertType"/>
        Important Notice  
    </font>
</td>

我尝试过以下代码:

Capybara.ignore_hidden_elements = false

session.find(:xpath, ".//*[@name = rdInsertType]", :match => :first).click

session.execute_script("('input').show()")

session.choose('Promotion', visible: false) 

但没用。任何建议都非常感谢。 在此先感谢

0 个答案:

没有答案