Class: Watir::Hidden

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

Overview

this class can be used to access hidden field objects Normally a user would not need to create this object as it is returned by the Watir::Container#hidden method

Constant Summary collapse

INPUT_TYPES =

:stopdoc:

["hidden"]

Constants inherited from Element

Element::TO_S_SIZE

Instance Attribute Summary

Attributes inherited from Element

#container

Attributes included from Container

#activeObjectHighLightColor, #page_container, #type_keys, #typingspeed

Instance Method Summary collapse

Methods inherited from TextField

#abhors_typing, #assert_not_readonly, #dragContentsTo, #drag_contents_to, #maxLength, #maxlength, #requires_typing, #to_s, #value=, #verify_contains

Methods inherited from InputElement

#initialize, #locate

Methods inherited from Element

#<=>, #activeObjectHighLightColor, #after_text, #assert_enabled, #assert_exists, #attribute_value, #before_text, #click, #click!, #click_no_wait, #document, #enabled?, #exists?, #fire_event, #flash, #initialize, #inspect, #ole_object, #ole_object=, #parent, #text, #to_s, #type_keys, #typingspeed

Methods included from Container

#area, #areas, #button, #buttons, #cell, #cells, #checkbox, #checkboxes, #dds, #divs, #dls, #dts, #element, #elements, #ems, #file_field, #file_fields, #form, #forms, #frame, #hidden, #hiddens, #image, #images, #labels, #link, #links, #lis, #locate_all_elements, #locate_input_element, #locate_tagged_element, #log, #map, #maps, #modal_dialog, #popup, #pres, #ps, #radio, #radios, #row, #rows, #select_list, #select_lists, #set_container, #show_all_objects, #spans, #strongs, #table, #tables, #text_field, #text_fields, #wait

Constructor Details

This class inherits a constructor from Watir::InputElement

Instance Method Details

#append(n) ⇒ Object

override the append method, so that focus isnt set to the hidden object



459
460
461
# File 'lib/watir/input_elements.rb', line 459

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

#clearObject

override the clear method, so that focus isnt set to the hidden object



464
465
466
# File 'lib/watir/input_elements.rb', line 464

def clear
  self.value = ""
end

#focusObject

this method will do nothing, as you cant set focus to a hidden field



469
470
# File 'lib/watir/input_elements.rb', line 469

def focus
end

#set(n) ⇒ Object

set is overriden in this class, as there is no way to set focus to a hidden field



454
455
456
# File 'lib/watir/input_elements.rb', line 454

def set(n)
  self.value = n
end

#visible?Boolean

Hidden element is never visible - returns false.

Returns:

  • (Boolean)


473
474
475
476
# File 'lib/watir/input_elements.rb', line 473

def visible?
  assert_exists
  false
end