小编ant*_*nts的帖子

如何在Capybara中使用fill_in和find(如果可能的话)

我想做以下但不能由于fill_in的性质期望定位器作为第一个参数.

find(:css, "input[id$='donation_pledge_hundreds']").fill_in :with => "10"
Run Code Online (Sandbox Code Playgroud)

我也尝试过

element = find(:css, "input[id$='donation_pledge_hundreds']")   
fill_in element.<method> , :with => "10"
Run Code Online (Sandbox Code Playgroud)

但是没有方法可以返回任何数据来识别fill_in元素.

有关通过正则表达式查找字段以与fill_in一起使用的最佳方法的任何想法吗?

find capybara

89
推荐指数
3
解决办法
5万
查看次数

标签 统计

capybara ×1

find ×1