Do mean you must 'iterate through' all the spans on the page? Or do you have a need to specifically enumerate them for later use?

If you do not need to save information from each span for later, and even if there is not a direct 'Watir way' to do this, the indirect approach should still be simple enough.

Get the page html  (ie.html), which is a string, and hunt for your tag. Having gotten the position of your span tag #1015 in the string, it should be simple enough to extract the id of your checkbox from the text immediately following. Using regular expressions, it should be a snap.

It is kind of a brute-force way of doing things, but it is simple and it works. I will watch this thread to see if anyone has a better way.

Lonny Eachus


Subject:
[Wtr-general] Need specific example of how to find a control inside a SPAN with a Custom Attribute.
From:
"Michael Cowan" <[EMAIL PROTECTED]>
Date:
Mon, 26 Jun 2006 08:49:44 -0700

Watir General Group;

 

I am relatively new to Watir and have run up against a problem I am unable to solve. I need to enumerate all the span tags on a page, find one with a custom attribute, and get access to the control inside that span tag.

 

 

 

Any help would be .. well .. helpful.

 

Thank you,

Michael Cowan



_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to