Class: Watir::Image

Inherits:
HTMLElement show all
Defined in:
lib/watir-webdriver/elements/image.rb,
lib/watir-webdriver/elements/generated.rb,
lib/watir-webdriver/elements/generated.rb

Constant Summary

Constants inherited from BaseElement

BaseElement::IGNORED_ATTRIBUTES

Instance Method Summary collapse

Methods inherited from BaseElement

attribute_list, #attribute_value, attributes, #click, #double_click, #driver, #element, #exists?, #fire_event, #flash, #focus, #html, #initialize, #inspect, #parent, #right_click, #run_checkers, #send_keys, #style, #tag_name, #text, typed_attributes, #value, #visible?

Methods included from Container

add

Methods included from XpathSupport

#element_by_xpath, #elements_by_xpath

Constructor Details

This class inherits a constructor from Watir::BaseElement

Instance Method Details

#file_created_dateObject

Raises:

  • (NotImplementedError)


29
30
31
32
# File 'lib/watir-webdriver/elements/image.rb', line 29

def file_created_date
  assert_exists
  raise NotImplementedError
end

#file_sizeObject

Raises:

  • (NotImplementedError)


34
35
36
37
# File 'lib/watir-webdriver/elements/image.rb', line 34

def file_size
  assert_exists
  raise NotImplementedError
end

#heightInteger

returns the image’s height in pixels

Returns:

  • (Integer)

    height



24
25
26
27
# File 'lib/watir-webdriver/elements/image.rb', line 24

def height
  assert_exists
  driver.execute_script "return arguments[0].height", @element
end

#save(path) ⇒ Object

Raises:

  • (NotImplementedError)


39
40
41
42
# File 'lib/watir-webdriver/elements/image.rb', line 39

def save(path)
  assert_exists
  raise NotImplementedError
end

#widthInteger

returns the image’s width in pixels

Returns:

  • (Integer)

    width



13
14
15
16
# File 'lib/watir-webdriver/elements/image.rb', line 13

def width
  assert_exists
  driver.execute_script "return arguments[0].width", @element
end