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

Posted by Daniel Cukier on Stack Overflow See other posts from Stack Overflow or by Daniel Cukier
Published on 2010-05-09T13:28:52Z Indexed on 2010/05/11 4:54 UTC
Read the original article Hit count: 552

Filed under:
|
|
|

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
    Given I am on the Form page
    When I fill in "field1" with "value1"
    And I fill in "field2" with "value2"
    And I press "OK"
    Then I should see "Form submited"

The problem is that I don't have the OK button in the form I need a way to do the "form.submit", without clicking any button or link - the same as happens when you press ENTER when you are in a form field using the browser.

I don't know how to tell capybara to submit a form. How can I do it?

© Stack Overflow or respective owner

Related posts about capybara

Related posts about ruby