HTML:
<div id='survey'>
Name:<input type='text' name='name'><br>
Like sushi?<input type="radio" name="sushi" value="yes">Yes
<input type="radio" name="sushi" value="no">No
</div>
规格:
within 'div#survey' do
fill_in 'name', with:'Joe Brown'
choose 'no'
end
这引发了例外:
Failure/Error: choose 'no'
Capybara::ElementNotFound:
Unable to find radio button "no"
如何选择单选按钮“否”?
答案 0 :(得分:1)
尝试选择“否”,因为标签文字为大写字母。