Capybara find

编程入门 行业动态 更新时间:2024-10-27 23:25:47
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?

更多推荐

本文发布于:2023-07-30 06:17:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1336687.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Capybara   find

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!