水豚在我的黄瓜测试中无法通过它的ID找到<p>
标记。当我save_and_open_page
时,我可以看到元素。但我不能用has_css?
或find
找到它:水豚不能通过ID找到元素
pry(#<Object>)> page.html.scan(/notice_sent/).count => 1 pry(#<Object>)> page.html.scan(/id=\"notice_sent\"/).count => 1 pry(#<Object>)> page.find('#notice_sent') Capybara::ElementNotFound: Unable to find css "#notice_sent" from /Users/me/.gem/ruby/2.1.7/gems/capybara-2.4.4/lib/capybara/node/finders.rb:41:in 'block in find'
我缺少什么?
是的 - 该ID在页面上,但wasn直到我在选项卡上添加点击 –