From 741c31bf2bc6ce8c9ac1af29ea985fa07e09d261 Mon Sep 17 00:00:00 2001 From: Keita Urashima Date: Thu, 20 May 2010 10:31:20 +0900 Subject: [PATCH] The input element which has no type attributes should be regarded as a text field. --- lib/capybara/xpath.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/capybara/xpath.rb b/lib/capybara/xpath.rb index 87e914f2..eb981b75 100644 --- a/lib/capybara/xpath.rb +++ b/lib/capybara/xpath.rb @@ -111,7 +111,7 @@ module Capybara def text_field(locator, options={}) options = options.merge(:value => options[:with]) if options.has_key?(:with) - add_field(locator, "//input[@type!='radio' and @type!='checkbox' and @type!='hidden']", options) + add_field(locator, "//input[not(@type) or (@type!='radio' and @type!='checkbox' and @type!='hidden')]", options) end def text_area(locator, options={})