class Selenium::WebDriver::Elements::Form
Public Class Methods
new(element, browser)
click to toggle source
Calls superclass method
Selenium::WebDriver::Elements::Element::new
# File lib/selenium/webdriver/elements/form.rb, line 9 def initialize element, browser super element, browser unless element.tag_name == 'form' raise TypeError.new "Can't create Form decorator for #{element.inspect}" end end
Public Instance Methods
populate(data)
click to toggle source
# File lib/selenium/webdriver/elements/form.rb, line 16 def populate data inputs = [] find_elements(:tag_name => 'input').each do |input| inputs << input if input.is_a? Textbox or input.is_a? Checkbox or input.is_a? FileChooser end inputs += find_elements :tag_name => 'textarea' inputs += find_elements :tag_name => 'select' inputs.each do |input| input.populate data[input['name']] end self end