在这种情况下,如何单击第一个链接:
<div class="item">
<a href="/agree/">Agree</a>
</div>
<div class="item">
<a href="/agree/">Agree</a>
</div>
within ".item" do
first(:link, "Agree").click
end
我得到这个错误:
Capybara::Ambiguous:
Ambiguous match, found 2 elements matching css ".item"
没有,within
我得到这个错误:
Failure/Error: first(:link, "Agree").click
NoMethodError:
undefined method `click' for nil:NilClass