Hi Tom,

I think an XPath _expression_ will make your life easy. As you said that the id's are generated dynamically, but there should be something that binds the checkboxes together (may be the item name etc.) So you can write an XPath query to select the checkboxes on the basis of item name.
So selection mechanism will look like:

ie.checkbox(:xpath , " //td[contains(., (item name) )]/input/ ")

This will first select a td that contains the item name and then select the input tag inside it. XPath doens't restrict you from using those tags that doesn't have a class in watir from using them in xpath _expression_. In your case if you want to access <tfoot> then your query will look like:

ie.checkbox(:xpath, " //tfoot[contains(. , (item name) )]/input/ ")

I don't know if I make myself clear here. If you still have doubt post your HTML here and lets see if we could provide any help.

PS: This extension will be available in watir 1.5, if you want to have a preview you can download the tar ball from CVS HEAD.

Regards,
Angrez


On 12/9/05, Tom < [EMAIL PROTECTED]> wrote:
Our developers got cute and decided to use the <tfoot> as the input row in a
dynamic table instead of using another table. In my scripts, I used to refer
to this input row using the :index and the table number, but now that it is
a table footer, I'm having problems accessing it. I checked watir.rb and a
search for 'foot' came up empty leading me to believe that <tfoot> is not
supported.

The row I'm trying to access contains a textfield and a couple of
checkboxes. I can access the textfield using :index,1 as it is the only
textfield on the page, but I'm having problems accessing the checkboxes.

Of course, nothing has a static id value...yet. I'm still working on them
about that. Since the table on the page is dynamic and the number of rows
varies as you add items, I cannot just enter a row number for the table to
access the input row.

Any suggestions (other then getting dev to add static :id values) would be
greatly appreciated.

Thanks,

Tom


_______________________________________________
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

Reply via email to