class Watir::Image

Public Instance Methods

file_created_date() click to toggle source
# File lib/watir-webdriver/elements/image.rb, line 41
def file_created_date
  assert_exists
  raise NotImplementedError, "not currently supported by WebDriver"
end
file_size() click to toggle source
# File lib/watir-webdriver/elements/image.rb, line 46
def file_size
  assert_exists
  raise NotImplementedError, "not currently supported by WebDriver"
end
height() click to toggle source

Returns the image's height in pixels.

@return [Fixnum] width

# File lib/watir-webdriver/elements/image.rb, line 36
def height
  assert_exists
  driver.execute_script "return arguments[0].height", @element
end
loaded?() click to toggle source

Returns true if image is loaded.

@return [Boolean]

# File lib/watir-webdriver/elements/image.rb, line 10
def loaded?
  return false unless complete?

  driver.execute_script(
    'return typeof arguments[0].naturalWidth != "undefined" && arguments[0].naturalWidth > 0',
    @element
  )
end
save(path) click to toggle source
# File lib/watir-webdriver/elements/image.rb, line 51
def save(path)
  assert_exists
  raise NotImplementedError, "not currently supported by WebDriver"
end
width() click to toggle source

Returns the image's width in pixels.

@return [Fixnum] width

# File lib/watir-webdriver/elements/image.rb, line 25
def width
  assert_exists
  driver.execute_script "return arguments[0].width", @element
end