Skip to content

Instantly share code, notes, and snippets.

@robholland
Created February 4, 2010 16:10
Show Gist options
  • Save robholland/294804 to your computer and use it in GitHub Desktop.
Save robholland/294804 to your computer and use it in GitHub Desktop.
diff --git a/lib/capybara/driver/selenium_driver.rb b/lib/capybara/driver/selenium_driver.rb
index d78cc51..70cc145 100644
--- a/lib/capybara/driver/selenium_driver.rb
+++ b/lib/capybara/driver/selenium_driver.rb
@@ -17,13 +17,13 @@ class Capybara::Driver::Selenium < Capybara::Driver::Base
end
def set(value)
- if tag_name == 'textarea' or (tag_name == 'input' and %w(text password hidden file).include?(type))
- node.clear
- node.send_keys(value.to_s)
- elsif tag_name == 'input' and type == 'radio'
+ if tag_name == 'input' and type == 'radio'
node.select
elsif tag_name == 'input' and type == 'checkbox'
node.toggle
+ else
+ node.clear
+ node.send_keys(value.to_s)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment