Showing posts from November, 2014

Cucumber and Capybara , How to Submit a Form Without a Button

Sometimes We run into  a problem where we need to submit a form after entering data but there is no specific button or link available on which we can perform operation to submit the I am going to suggest few solutions today for these situations in few different ways so that any one can use the solution depending on his specific situation.

Where we can hit "Enter" to submit the form:

We can access the selenium send_keys method to invoke a return event like
Using  java script:
 When /^I submit the form$/ do
Without Using java Script:
     we can handle this directly using Racktest(Capybara's default driver)
  When /^I submit the "([^\"]*)" form$/ do |form_id|
    element = find_by_id(form_id), element.native).submit :name => nil
Where we cannot hit "Enter" to submit :

  We can click…

How to Use Object Repository in Xml format In Selenium Webdriver

You can use XML as object repository like
 And you can use the code for retrieve the objects from xml below is the code: