class Watir::FramedDriver

@api private

another hack..

Public Class Methods

new(element, driver) click to toggle source
# File lib/watir-webdriver/elements/iframe.rb, line 124
def initialize(element, driver)
  @element = element
  @driver = driver
end

Public Instance Methods

==(other) click to toggle source
# File lib/watir-webdriver/elements/iframe.rb, line 129
def ==(other)
  wd == other.wd
end
Also aliased as: eql?
eql?(other)
Alias for: ==
send_keys(*args) click to toggle source
# File lib/watir-webdriver/elements/iframe.rb, line 134
def send_keys(*args)
  switch!
  @driver.switch_to.active_element.send_keys(*args)
end

Protected Instance Methods

wd() click to toggle source
# File lib/watir-webdriver/elements/iframe.rb, line 141
def wd
  @element
end

Private Instance Methods

method_missing(meth, *args, &blk) click to toggle source
# File lib/watir-webdriver/elements/iframe.rb, line 147
def method_missing(meth, *args, &blk)
  if @driver.respond_to?(meth)
    switch!
    @driver.send(meth, *args, &blk)
  else
    @element.send(meth, *args, &blk)
  end
end
switch!() click to toggle source
# File lib/watir-webdriver/elements/iframe.rb, line 156
def switch!
  @driver.switch_to.frame @element
rescue Selenium::WebDriver::Error::NoSuchFrameError => e
  raise Exception::UnknownFrameException, e.message
end