I am pretty sure you can just do b.divs(:class => 'formError') should collect all the divs with that class
On Tue, Dec 20, 2011 at 10:51 AM, Joe Fl <[email protected]> wrote: > > Hi, > > I want to retrieve the text listed in the alert class listed below. > > > <div class="alert"> > <div class="formError">Please provide a title.</div> > <div class="formError">Please select an event start date.</div> > <div class="formError">Please select an event end date.</div> > </div> > > > I have the following code: > > error_text = @b.div(:class,"alert").div > error_text.each do|et| > puts et.text > end > > I have tried a couple variations but can't get the correct method. > > Thank you, > Joe > > On Nov 7, 10:23 am, Jari Bakken <[email protected]> wrote: > > On Mon, Nov 7, 2011 at 3:41 PM, Joe Fleck <[email protected]> wrote: > > > Okay, I just the answer that works in getting the class name. > > > > > .attribute_value('*class*') > > > > .class_name would work as well. > > -- > Before posting, please read http://watir.com/support. In short: search > before you ask, be nice. > > [email protected] > http://groups.google.com/group/watir-general > [email protected]<http://groups.google.com/group/watir-general%[email protected]> > -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. [email protected] http://groups.google.com/group/watir-general [email protected]
