Sha256: 72eecc173869af7c2684b50d91382c0cb1d0a1a179830c772eced65b408403dd

Contents?: true

Size: 775 Bytes

Versions: 10

Compression:

Stored size: 775 Bytes

Contents

# encoding: utf-8
module Watir
  class Image < HTMLElement

    alias_method :loaded?, :complete?

    #
    # returns the image's width in pixels
    #
    # @return [Integer] width
    #

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

    #
    # returns the image's height in pixels
    #
    # @return [Integer] height
    #

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

    def file_created_date
      assert_exists
      raise NotImplementedError
    end

    def file_size
      assert_exists
      raise NotImplementedError
    end

    def save(path)
      assert_exists
      raise NotImplementedError
    end

  end # Image
end # Watir

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
watir-webdriver-0.0.7 lib/watir-webdriver/elements/image.rb
watir-webdriver-0.0.6 lib/watir-webdriver/elements/image.rb
watir-webdriver-0.0.5 lib/watir-webdriver/elements/image.rb
watir-webdriver-0.0.4 lib/watir-webdriver/elements/image.rb
watir-webdriver-0.0.3 lib/watir-webdriver/elements/image.rb
watir-webdriver-0.0.2 lib/watir-webdriver/elements/image.rb
watir-webdriver-0.0.1 lib/watir-webdriver/elements/image.rb
watir-webdriver-0.0.1.dev7 lib/watir-webdriver/elements/image.rb
watir-webdriver-0.0.1.dev6 lib/watir-webdriver/elements/image.rb
watir-webdriver-0.0.1.dev5 lib/watir-webdriver/elements/image.rb