I have tried "new and improved" image.to_s and "brand new" ie.file_fields
and they work just fine! :)
But...
Why "value" and "disabled" are not removed from image.to_s? Is there any
reason that it should be there?
Unit tests report this failures (I think they were reported also the last
time I installed watir, but I forgot to report it then):
1) Failure:
test_http_errors(TC_Navigate)
[C:/watir_bonus/unitTests/../unittests/navigate_test.rb:51]:
<Watir::Exception::NavigationException> exception expected but none was
thrown.
2) Failure:
test_button_frames(TC_show_frames)
[C:/watir_bonus/unitTests/../unittests/frame_test.rb:113:in
`capture_and_compare'
C:/watir_bonus/unitTests/../unittests/frame_test.rb:125:in
`test_button_frames']:
<"there are 2 frames\nframe index: 0 name: buttonFrame\nframe index: 1
name: buttonFrame2\n"> expected but was
<"there are 2 frames\nframe index: 1 name: buttonFrame\nframe index: 2
name: buttonFrame2\n">.
3) Failure:
test_iframes(TC_show_frames)
[C:/watir_bonus/unitTests/../unittests/frame_test.rb:113:in
`capture_and_compare'
C:/watir_bonus/unitTests/../unittests/frame_test.rb:133:in
`test_iframes']:
<"there are 2 frames\nframe index: 0 name: senderFrame\nframe index: 1
name: receiverFrame\n"> expected but was
<"there are 2 frames\nframe index: 1 name: senderFrame\nframe index: 2
name: receiverFrame\n">.
4) Failure:
test_show_nested_frames(TC_show_frames)
[C:/watir_bonus/unitTests/../unittests/frame_test.rb:113:in
`capture_and_compare'
C:/watir_bonus/unitTests/../unittests/frame_test.rb:117:in
`test_show_nested_frames']:
<"there are 2 frames\nframe index: 0 name: nestedFrame\nframe index: 1
name: nestedFrame2\n"> expected but was
<"there are 2 frames\nframe index: 1 name: nestedFrame\nframe index: 2
name: nestedFrame2\n">.
182 tests, 1060 assertions, 4 failures, 0 errors
Zeljko
-----Original Message-----
From: Zeljko Filipin [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 28, 2005 7:46 AM
To: '[email protected]'
Subject: RE: [Wtr-general] RE: image.to_s
Thanks again.
About "type: image" - after I thought about it, I also think it should not
be removed.
Zeljko
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Paul Rogers
Sent: Thursday, July 28, 2005 12:45 AM
To: [email protected]
Subject: RE: [Wtr-general] RE: image.to_s
I added alt as a property and included it in the to_s
As to why the typs= 'image' is available. It's a standard property from
IE on input controls, like button, etc. I just continued it on. Maybe
this is something that should be removed?
At some point I think we want to add a elements iterator that goes
through all the items on the page, and I guess having the type available
may help
Paul
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Zeljko Filipin
Sent: 21 July 2005 07:17
To: [email protected]
Subject: [Wtr-general] RE: image.to_s
And also required property "alt" is not displayed.
Zeljko
-----Original Message-----
From: Zeljko Filipin [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 21, 2005 3:08 PM
To: [email protected]
Subject: image.to_s
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
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general