我正在尝试使用下一个代码获取下拉框的选定值:
scenario 'USA as default country' do
expect(page).to have_select('report_country_code', selected: 'United States')
end
此字段的Html是下一个:
<select class="form-control country required" name="report[country_code]" id="report_country_code">
<option value="US">United States</option>
....
....
<option value="ZW">Zimbabwe</option>
</select>
错误如下:
expected to find select box "report_country_code" with "United States" selected but there were no matches. Also found "United States .... Zimbabwe", which matched the selector but not all filters.
答案 0 :(得分:0)
有同样的问题。 <{3}}帮助了我
sudo apt-get install libxml2-dev