Class: FireWatir::FileField
- Inherits:
-
InputElement
- Object
- Element
- InputElement
- FireWatir::FileField
- Defined in:
- lib/firewatir/elements/file_field.rb
Overview
Description:
Class for FileField element.
Constant Summary collapse
- INPUT_TYPES =
["file"]
Constants inherited from Element
Element::FIRST_ORDERED_NODE_TYPE, Element::NUMBER_TYPE, Element::ORDERED_NODE_ITERATOR_TYPE, Element::TO_S_SIZE
Constants included from Container
Container::DEFAULT_HIGHLIGHT_COLOR, Container::MACHINE_IP
Instance Attribute Summary
Attributes inherited from InputElement
Attributes inherited from Element
Instance Method Summary collapse
-
#set(path) ⇒ Object
Description: Sets the path of the file in the textbox.
Methods inherited from InputElement
Methods inherited from Element
#assert_enabled, #assert_exists, #attribute_value, #click, #contains_text, #disabled, #document_var, #element_by_xpath, #element_type, #elements_by_xpath, #enabled?, #exists?, #fire_event, #initialize, #inspect, #method_missing, #text, #to_s, #visible?, #wait
Methods included from Container
#button, #cell, #checkbox, #dd, #dl, #dt, #file_field, #form, #frame, #hidden, #image, #link, #radio, #row, #select_list, #show_all_objects, #table, #text_field
Methods included from JsshSocket
#js_eval, #js_eval_method, #jssh_socket, #read_socket
Constructor Details
This class inherits a constructor from FireWatir::InputElement
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class FireWatir::Element
Instance Method Details
#set(path) ⇒ Object
Description:
Sets the path of the file in the textbox.
Input:
path - Path of the file.
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/firewatir/elements/file_field.rb', line 16 def set(path) assert_exists path.gsub!("\\", "\\\\\\") jssh_socket.send("#{element_object}.value = \"#{path}\";\n", 0) read_socket() @o.fireEvent("onChange") @@current_level = 0 end |