我正在使用Cucumber测试网站,我想单击登录图标,但是出现以下错误:
@b.p(text:"Se connecter").click
Watir::Exception::UnknownObjectException: element located, but timed out after 30 seconds, waiting for #<Watir::Paragraph: located: true; {:text=>"Se connecter", :tag_name=>"p"}> to be present
from /usr/local/rvm/gems/ruby-2.5.1/gems/watir-6.12.0/lib/watir/elements/element.rb:627:in `raise_present'
这是我的考试:
@b.p(text:"Se connecter").visible?
2019-04-02 15:42:30 WARN Watir ["visible_element"] #visible? behavior will be changing slightly, consider switching to #present? (more details: http://watir.com/element-existentialism/)
=> false
但是我确实在页面上看到了文字。
pry(#<Object>)> @b.p(text:"Se connecter").exist?
=> true
pry(#<Object>)> @b.p(text:"Se connecter").enabled?
=> true
我也尝试单击其他元素,但是它也不起作用。
感谢帮助