Re: [Wtr-general] return table element content type value

2007-06-27 Thread Charley Baker

There is no type for an html element. They are all strings. You can
certainly add your own validations on the strings you get back, regexes may
help: http://www.rubycentral.com/book/tut_stdtypes.html

-Charley


On 6/27/07, Max Russell [EMAIL PROTECTED] wrote:


 Is there a way to return the content type and value ( in this case, from
an element of a table)?

Something along the lines of the ie.show_all_objects command , but
specifically applied to one object under scrutiny?



This is needed to inspect table element for returned types (strings etc.)





*Max Russell*
Test Analyst
*INPS*



___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] return table element content type value

2007-06-27 Thread marekj

Max.
I am curious what you are trying to do because I may have to do something
similar.
For example.
Running this code:

$ie.tables.each do |table|
 puts table.class
 puts table
 table.each do |row|
   puts row.class
   puts row
   row.each do |cell|
 puts cell.class
   end
 end
end


will return some elements of this kind

Watir::Table
Watir::TableRow
Watir::TableCell

For Table and Table Row you have the following attributes you can
interrogate (cell speaks text only I think)
Watir::Table
type:
id:
name:
value:
disabled: false
rows: 1
cols: 3
Watir::TableRow
type:
id:
name:
value:
disabled: false

I ran the code against http://google.com/ page
I am not sure what 'type' here is meant to return and what about 'value'?

You can construct some code that talks to TableBodies too.

so what are you trying to extract exactly?

On 6/27/07, Max Russell [EMAIL PROTECTED] wrote:


 Is there a way to return the content type and value ( in this case, from
an element of a table)?

Something along the lines of the ie.show_all_objects command , but
specifically applied to one object under scrutiny?



This is needed to inspect table element for returned types (strings etc.)





*Max Russell*
Test Analyst
*INPS*



___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general