[Wtr-general] Lists question

Attebery, Bill Bill.Attebery at twtelecom.com
Tue Jul 11 17:12:32 EDT 2006


Has anyone written code to handle <UL>/<OL> and <LI> tags -- as a
collection with iterators?
I have the following HTML -- and I'd like to be able to handle the LIs
as a collection and iterate through them (and access the link within)
based on the text -- has anyone done this?  If not I presume I'll have
to extend watir and essentially clone the  Spans, Divs or Ps classes and
methods?
Any suggestions?

I'd like to do something link this:

$ie.lis.each do |li|
  if li.text == /FOO/
     puts 'FOO found'
     li.link(:index, 1).click
  else
     puts 'FOO not found'
  end
end

<span class="errorMsg" style="FONT-WEIGHT: bold"><p>This document can
not be saved until the following issues are resolved: </p>
    <ul>
        <li>REVENUE CITY: Please fill in this required field.
            <a onclick="ClickByID2('RevenueCity')">
            <img style="VERTICAL-ALIGN: 0px" height="13" alt="Go to the
field" src="http://earl:9080/foep/errorMsg.gif" width="15"
border="0"></a>
        </li>
        <li>LEGAL ENTITY: Please fill in this required field.
            <a onclick="ClickByID2('LegalEntity')">
            <img style="VERTICAL-ALIGN: 0px" height="13" alt="Go to the
field" src="http://earl:9080/foep/errorMsg.gif" width="15"
border="0"></a>
        </li>
    </ul>
</span>








The content contained in this electronic message is not intended to
constitute formation of a contract binding TWTC.  TWTC will be
contractually bound only upon execution, by an authorized officer, of
a contract including agreed terms and conditions or by express
application of its tariffs.

This message is intended only for the use of the individual or entity
to which it is addressed. If the reader of this message is not the
intended recipient, or the employee or agent responsible for
delivering the message to the intended recipient, you are hereby
notified that any dissemination, distribution or copying of this
message is strictly prohibited. If you have received this
communication in error, please notify us immediately by replying to
the sender of this E-Mail or by telephone.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060711/a760adcb/attachment.html 


More information about the Wtr-general mailing list