How do I simulate hitting enter in an input field with Capybara and ChromeDriver?

前端 未结 6 1311
我在风中等你
我在风中等你 2020-12-24 11:42

I have the following helper method to input a string into an input field and press the enter key, but it seems the enter key is never pressed. I see the string entered into

6条回答
  •  感情败类
    2020-12-24 12:09

    find('#q_name').native.send_keys(:return)
    

    works for me. I dont have a name or id for my field but the type is input so i used something like

    find('.myselector_name>input').native.send_keys(:return)
    

    works perfectly fine!

提交回复
热议问题