I am making unit tests for my methods and I found a bug in watir. I wanted to display properties of an image. HTML is valid according to http://validator.w3.org/.
---------- HTML: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <title> images </title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> </head> <body> <p> <img src="images/flower.png" alt="flower" /> </p> </body> </html> ---------- IRB: irb require 'watir' ie = Watir::IE.attach(:title, //) ie.images.each { |i| puts i.to_s } ---------- OUTPUT: type: image id: name: value: disabled: false src: file:///C:/Documents%20and%20Settings/zfilipin/My%20Documents/Tests/test/htm l/images/flower.png file date: 07/13/2005 file size: 1252 width: 20 height: 20 ---------- Then I added missing id, name, value, and disabled, so img tag is: <img src="images/flower.png" alt="flower" id="image_id" name="image_name" value="image_value" disabled="disabled" /> ---------- OUTPUT: ... id: image_id name: image_name value: image_value disabled: true ... ---------- So where is the bug? My page is no longer valid. I get this error messages: "there is no attribute name/value/disabled". Even if I change my page back to html 4.01 I get error messages: "there is no attribute value/disabled". So, name was once alloved, but value and disabled not even then. What is the purpose of displaying properties that do not exist? Not related to this, but what is purpose of "type: image" in output? Can it be anything else except image? Zeljko _______________________________________________ Wtr-general mailing list [email protected] http://rubyforge.org/mailman/listinfo/wtr-general
