Description:
Class for Image element.
Description:
Initializes the instance of image object.
Input:
- how - Attribute to identify the image element. - what - Value of that attribute.
# File lib/firewatir/elements/image.rb, line 17 def initialize(container, how, what) @how = how @what = what @container = container end
Description:
Gets the height of the image in pixels, as a string.
Output:
Height of image (in pixels).
# File lib/firewatir/elements/image.rb, line 93 def height assert_exists return @o.invoke("height").to_s end
Description:
Locate the image element on the page.
# File lib/firewatir/elements/image.rb, line 26 def locate case @how when:jssh_name @element_name = @what when :xpath @element_name = element_by_xpath(@container, @what) else @element_name = locate_tagged_element('IMG', @how, @what) end @o = self end
returns a string representation of the object
# File lib/firewatir/elements/image.rb, line 55 def to_s assert_exists super({"src" => "src","width" => "width","height" => "height","alt" => "alt"}) end
Description:
Gets the width of the image in pixels, as a string.
Output:
Width of image (in pixels).
# File lib/firewatir/elements/image.rb, line 81 def width assert_exists return @o.invoke("width").to_s end