Capybara find_field&has_selector不工作(Capybara find_field & has_selector not working)
我正在使用Capybara并从发现者的'find_field'和'has_selector'中获取错误。
我试过像这样使用它们:
page = visit "http://www.my-url-here.com" next if page.has_selector?('#divOutStock') page.find_field('#txtQty').set('9999')has_selector返回错误:“NoMethodError:undefined method`has_selector?' for {“status”=>“success”}:Hash“
find_field找不到该字段。 (它出现在页面上,不是隐藏字段。)
我也尝试使用fill_in来设置字段值,这也不起作用。
我如何才能与Capybara合作?
I am using Capybara and getting errors from the finders 'find_field' & 'has_selector'.
I have tried using them like this:
page = visit "http://www.my-url-here.com" next if page.has_selector?('#divOutStock') page.find_field('#txtQty').set('9999')has_selector returns the error: "NoMethodError: undefined method `has_selector?' for {"status"=>"success"}:Hash"
find_field cannot find the field. (It is present on the page and is not a hidden field.)
I have also tried using fill_in to set the field value, that doesn't work either.
How can I get this to work with Capybara?
更多推荐
发布评论