Cucumber, capybara and selenium - Submitting a form without a button

后端 未结 12 2034
挽巷
挽巷 2021-02-01 18:14

I have a test using Cucumber, capybara and selenium driver. This test should go to a form and submit it. The normal text would be

  Scenario: Fill form
    Give         


        
12条回答
  •  甜味超标
    2021-02-01 18:57

    With the capybara Selenium driver you can do something like this:

    within(:xpath, "//form[@id='the_form']") do
      locate(:xpath, "//input[@name='the_input']").set(value)
      locate(:xpath, "//input[@name='the_input']").node.send_keys(:return)
    end
    

提交回复
热议问题