class Watir::IFrameCollection

Public Instance Methods

to_a() click to toggle source
# File lib/watir-webdriver/elements/iframe.rb, line 66
def to_a
  # In case `#all_elements` returns empty array, but `#elements`
  # returns non-empty array (i.e. any frame has loaded between these two calls),
  # index will return nil. That's why `#all_elements` should always
  # be called after `#elements.`
  element_indexes = elements.map { |el| all_elements.index(el) }
  element_indexes.map { |idx| element_class.new(@parent, tag_name: @selector[:tag_name], index: idx) }
end

Private Instance Methods

all_elements() click to toggle source
# File lib/watir-webdriver/elements/iframe.rb, line 77
def all_elements
  selector = { tag_name: @selector[:tag_name] }

  element_validator = element_validator_class.new
  selector_builder = selector_builder_class.new(@parent, selector, element_class.attribute_list)
  locator = locator_class.new(@parent, selector, selector_builder, element_validator)

  locator.locate_all
end