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 <joeflec...@gmail.com> 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 <jari.bak...@gmail.com> wrote: > > On Mon, Nov 7, 2011 at 3:41 PM, Joe Fleck <joeflec...@gmail.com> 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. > > watir-general@googlegroups.com > http://groups.google.com/group/watir-general > watir-general+unsubscr...@googlegroups.com<http://groups.google.com/group/watir-general%0awatir-general+unsubscr...@googlegroups.com> > -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com