Capybara can find but not fill_in

后端 未结 3 846
梦如初夏
梦如初夏 2021-02-13 16:50

I am having some very strange behaviour with Capybara. It stubbornly refuses to fill in the fields of my login form.

3条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-13 17:52

    if it is an autocomplete field, you can use this:

      def fill_in_autocomplete(id, value)
        page.execute_script("document.getElementById('#{id}').setAttribute('value', '#{value}');")
      end
    
    

提交回复
热议问题