Sha256: a379bc4a33dd019129e1cb9bc19c571409c0e339a6badb1533c54cc5ef9d8b43

Contents?: true

Size: 878 Bytes

Versions: 17

Compression:

Stored size: 878 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

  module Container
     alias_method :image, :img
     alias_method :images, :imgs
  end # Container

end # Watir

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
watir-webdriver-0.2.1 lib/watir-webdriver/elements/image.rb
watir-webdriver-0.2.0 lib/watir-webdriver/elements/image.rb
watir-webdriver-0.2.0.dev2 lib/watir-webdriver/elements/image.rb
watir-webdriver-0.2.0.dev lib/watir-webdriver/elements/image.rb
watir-webdriver-0.1.9 lib/watir-webdriver/elements/image.rb
watir-webdriver-0.1.8 lib/watir-webdriver/elements/image.rb
watir-webdriver-0.1.7 lib/watir-webdriver/elements/image.rb
watir-webdriver-0.1.6 lib/watir-webdriver/elements/image.rb
watir-webdriver-0.1.5 lib/watir-webdriver/elements/image.rb
watir-webdriver-0.1.4 lib/watir-webdriver/elements/image.rb
watir-webdriver-0.1.3 lib/watir-webdriver/elements/image.rb
watir-webdriver-0.1.2 lib/watir-webdriver/elements/image.rb
ayanko-watir-webdriver-0.1.1.1 lib/watir-webdriver/elements/image.rb
watir-webdriver-0.1.1 lib/watir-webdriver/elements/image.rb
watir-webdriver-0.1.0 lib/watir-webdriver/elements/image.rb
watir-webdriver-0.0.9 lib/watir-webdriver/elements/image.rb
watir-webdriver-0.0.8 lib/watir-webdriver/elements/image.rb