I wanted to get the physical description of all the objects
(regardless of what they are), in a specified Table cell.
The html code is as under:-

<table id="xyz" class="cmbBox" border="0" style="height:50px;width:
350px;">
<tr>
<td><input id="0" type="radio"
name="List$0"
tabindex="2" /><label for="0">abc</label></td>
</tr><tr>
<td><input id="1" type="checkbox"
name="List$1"
tabindex="2" /><label for="1">def</label>
<input id="6" type="radio"
name="List$6"
tabindex="2" /><label for="6">stu</label></td>
</tr><tr>
<td><input id="2" type="checkbox"
name="List$2"
tabindex="2" /><label for="2">ghi</label></td>
</tr><tr>
<td><input id="3" type="checkbox"
name="List$3"
tabindex="2" /><label for="3">jkl</label></td>
</tr>
</table>

And the code I am using is-:

require 'watir'

$ie=Watir::IE.new()

$ie.goto("file:///E:\\happy1.htm")

puts  "Number of Tables"
puts $ie.tables.length
$ie.tables.each do |table|
table.each do |row|
 row.each do |cell|
 a=cell
 puts "Label"
 a.labels.show
 puts "Object"
 puts a.show_all_objects
 puts"\n"
 end
 end
end

 $ie.close


And the result I am getting is :-

Number of Tables
1
Label
index id                  name                htmlFor
1
Object
-----------Objects in page -------------
radio             name=List$0         id=0
value=on            alt=                src=
nil

Label
index id                  name                htmlFor
1
2
Object
-----------Objects in page -------------
checkbox          name=List$1         id=1
value=on            alt=                src=
radio             name=List$6         id=6
value=on            alt=                src=
nil

Label
index id                  name                htmlFor
1
Object
-----------Objects in page -------------
checkbox          name=List$2         id=2
value=on            alt=                src=
nil

Label
index id                  name                htmlFor
1
Object
-----------Objects in page -------------
checkbox          name=List$3         id=3
value=on            alt=                src=
nil



As you can see, I am not able to identify the Attributes (in this case
"for") for the Label in the Table cell.

Please help....
Thanks in advance :)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---

Reply via email to