Ethan and Željko, Both of your methods have worked for me.
I guess it comes down to which one provides the best efficiency? On Dec 11, 9:10 am, Ethan <[email protected]> wrote: > element collections extend Enumerable, don't they? > so > > expand_images = browser.images.select do |image| > image.alt =~ /^expand/ > end > > should work, and not have nils > > On Thu, Dec 10, 2009 at 17:07, Željko Filipin <[email protected] > > > > > wrote: > > On Thu, Dec 10, 2009 at 10:59 PM, bender25 <[email protected]> wrote: > > > Do you know how to keep these nil entries out of the image collection? > > > expand_images_and_nils = browser.images.collect do |image| > > > image if image.alt =~ /^expand/ > > end > > > expand_images = expand_images_and_nils.compact > > > More information: > > >http://www.ruby-doc.org/core/classes/Array.html#M002216 > > > Željko > > > -- > > You received this message because you are subscribed to the Google Groups > > "Watir General" group. > > To post to this group, send email to [email protected] > > Before posting, please read the following guidelines: > >http://wiki.openqa.org/display/WTR/Support > > To unsubscribe from this group, send email to > > [email protected] > > For more options, visit this group at > >http://groups.google.com/group/watir-general- Hide quoted text - > > - Show quoted text - -- You received this message because you are subscribed to the Google Groups "Watir General" group. To post to this group, send email to [email protected] Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/watir-general
