Class: Watir::Hidden

Inherits:
TextField show all
Defined in:
lib/watir-classic/input_elements.rb

Overview

Returned by the Container#hidden.

Instance Attribute Summary

Attributes inherited from Element

#container

Attributes included from Container

#page_container

Instance Method Summary collapse

Methods inherited from TextField

#drag_contents_to, #maxlength, #readonly?, #size, #to_s, #value=, #verify_contains

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, #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

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

message_for_unable_to_locate

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

#append(value) ⇒ Object

See Also:



405
406
407
# File 'lib/watir-classic/input_elements.rb', line 405

def append(value)
  self.value = self.value.to_s + value.to_s
end

#clearObject

See Also:



410
411
412
# File 'lib/watir-classic/input_elements.rb', line 410

def clear
  self.value = ""
end

#focusObject

This method will do nothing since it is impossible to set focus to a hidden field.



416
417
# File 'lib/watir-classic/input_elements.rb', line 416

def focus
end

#set(value) ⇒ Object

See Also:



400
401
402
# File 'lib/watir-classic/input_elements.rb', line 400

def set(value)
  self.value = value
end

#visible?Boolean

Returns always false, since hidden element is never visible.

Returns:

  • (Boolean)

    always false, since hidden element is never visible.



421
422
423
424
# File 'lib/watir-classic/input_elements.rb', line 421

def visible?
  assert_exists
  false
end