Class: Watir::FileField

Inherits:
Input show all
Defined in:
lib/watir-webdriver/elements/file_field.rb

Constant Summary

Constants inherited from BaseElement

BaseElement::IGNORED_ATTRIBUTES

Instance Method Summary collapse

Methods inherited from Input

#enabled?, #to_button, #to_checkbox, #to_radio, #to_select_list, #type

Methods inherited from BaseElement

attribute_list, #attribute_value, attributes, #click, #double_click, #driver, #element, #exists?, #fire_event, #flash, #focus, #html, #initialize, #inspect, #parent, #right_click, #run_checkers, #send_keys, #style, #tag_name, #text, typed_attributes, #visible?

Methods included from Container

add

Methods included from XpathSupport

#element_by_xpath, #elements_by_xpath

Constructor Details

This class inherits a constructor from Watir::BaseElement

Instance Method Details

#set(value) ⇒ Object

Set the file field to the given path

Parameters:



15
16
17
18
# File 'lib/watir-webdriver/elements/file_field.rb', line 15

def set(value)
  assert_exists
  @element.send_keys value
end

#valueString

Return the value of this field

Returns:



26
27
28
29
30
# File 'lib/watir-webdriver/elements/file_field.rb', line 26

def value
  # since 'value' is an attribute on input fields, we override this here
  assert_exists
  @element.value
end