2
for i in 0..10
  if @b.text_field(:cols  => "40", :index => i).exists?
    id = @b.text_field(:cols  => "40", :index => i)
    if profile_profile_qualifications_attributes_new_(\d)+_comment/.match(id)
      @b.text_field(:cols  => "40", :index => i).set "Rock!"
    end
  end
end

上面的代码失败了

错误:无法将 Watir::TextField 转换为字符串 (TypeError)
4

1 回答 1

1
id = @b.text_field(:cols  => "40", :index => i).id
于 2013-02-13T15:39:23.360 回答