An example to grab the first image loaded on a page and return the width and height.
$ie.goto(url)
width = $ie.image(:index,1).width
widthnum = Integer(width) #Convert to integer. #
if widthnum >50
f.puts “- SUCCESS: Width of image loaded: #{widthnum}”
else
f.puts “!!!!! WARNING: Did not find width for image on page !!!!!”
end
height = $ie.image(:index,1).height
heightnum = Integer(height) #Convert string to integer. #
if heightnum > 50 #height != nil (pixel version) #
f.puts “- SUCCESS: Height of image loaded: #{heightnum}”
else
f.puts “!!!!! WARNING: Did not find height for image on page !!!!!”
end

You must log in to post a comment.