Class: Watir::TextFields

Inherits:
ElementCollections show all
Defined in:
lib/watir/collections.rb

Overview

this class accesses the text fields in the document as a collection Normally a user would not need to create this object as it is returned by the Watir::Container#text_fields method

Instance Method Summary collapse

Methods inherited from ElementCollections

#[], #each, #first, #get_length_of_input_objects, #initialize, #inspect, #last, #show, #to_s

Constructor Details

This class inherits a constructor from Watir::ElementCollections

Instance Method Details

#element_classObject



211
# File 'lib/watir/collections.rb', line 211

def element_class; TextField; end

#lengthObject

number of text_fields

browser.text_fields.length


214
215
216
217
218
# File 'lib/watir/collections.rb', line 214

def length
  # text areas are also included in the TextFields, but we need to get them seperately
  get_length_of_input_objects(["text", "password"]) +
  @container.document.getElementsByTagName("textarea").length
end