Class: Watir::FileField
- Inherits:
-
InputElement
- Object
- Element
- InputElement
- Watir::FileField
- Defined in:
- lib/watir-classic/dialogs/file_field.rb
Overview
Returned by Container#file_field.
Constant Summary collapse
- WINDOW_TITLES =
File upload dialog titles to search for.
[/choose file( to upload)?/i, "Elegir archivos para cargar", "Datei zum Hochladen"]
- OK_BUTTON_VALUES =
File upload dialog “OK” button values to search for.
['&Open', '&Abrir', '&ffnen']
- CANCEL_BUTTON_VALUES =
File upload dialog “Cancel” button values to search for.
['Cancel', 'Abbrechen']
Instance Attribute Summary
Attributes inherited from Element
Attributes included from Container
Instance Method Summary collapse
-
#set(file_path) ⇒ Object
(also: #value=)
Set the path of the file field.
Methods inherited from InputElement
#alt, #disabled?, #label, #name, #required?, #src, #type, #value
Methods inherited from Element
#<=>, #attribute_value, #class_name, #click, #disabled?, #double_click, #enabled?, #exists?, #fire_event, #flash, #focus, #focused?, #id, #initialize, #inner_html, #inspect, #method_missing, #ole_object, #outer_html, #parent, #right_click, #send_keys, #style, #tag_name, #text, #title, #to_s, #to_subtype, #unique_number, #visible?
Methods included from DragAndDropHelper
#drag_and_drop_by, #drag_and_drop_on
Methods included from Container
#a, #abbr, #address, #alert, #area, #article, #aside, #audio, #b, #base, #bdi, #bdo, #blockquote, #body, #br, #button, #canvas, #caption, #checkbox, #cite, #code, #col, #colgroup, #command, #data, #datalist, #dd, #del, #details, #dfn, #div, #dl, #dt, #element, #em, #embed, #fieldset, #figcaption, #figure, #file_field, #font, #footer, #form, #frame, #frameset, #h1, #h2, #h3, #h4, #h5, #h6, #head, #header, #hgroup, #hidden, #hr, #i, #img, #input, #ins, #kbd, #keygen, #label, #legend, #li, #map, #mark, #menu, #meta, #meter, #modal_dialog, #nav, #noscript, #object, #ol, #optgroup, #option, #output, #p, #param, #pre, #progress, #q, #radio, #rp, #rt, #ruby, #s, #samp, #script, #section, #select, #small, #source, #span, #strong, #style, #sub, #summary, #sup, #table, #tbody, #td, #text_field, #textarea, #tfoot, #th, #thead, #time, #title, #tr, #track, #u, #ul, #var, #video, #wbr
Methods included from Exception
Methods included from ElementExtensions
#present?, #wait_until_present, #wait_while_present, #when_present
Constructor Details
This class inherits a constructor from Watir::Element
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Watir::Element
Instance Method Details
#set(file_path) ⇒ Object Also known as: value=
Set the path of the file field.
30 31 32 33 34 35 36 37 |
# File 'lib/watir-classic/dialogs/file_field.rb', line 30 def set(file_path) assert_file_exists(file_path) assert_exists click_no_wait set_file_name file_path.gsub(File::SEPARATOR, File::ALT_SEPARATOR) .click Wait.until(5) {value.include?(File.basename(file_path))} end |