Interesting. I found the options() method from the rdoc. However, I do not get the behaviour I expect.
Use getAllContents() instead; this does return an array, as expected. Alex On 12 Feb 2009, at 19:15, Jason Shelton wrote: > I tried the following code, and I am getting the undefined method > error. Am I missing a library? Thanks in advance. > > items = $ie.select_list(:name, 'xxx') > itemsArray = items.options() > > - Shelton > > > > From: a.j.collins...@gmail.com > To: watir-general@googlegroups.com > Subject: [wtr-general] Re: Drop down Contents > Date: Thu, 12 Feb 2009 18:33:22 +0000 > > > You can compare arrays very easily in ruby use the == method. I > think order matters so you might wish to sort (.sort) your array. > > There is a method on a select box to get all of the options > ( .options() ). This returns an array. > > You can then store your expected results in an array and compare the > two. > > Alex > > On 12 Feb 2009, at 17:29, Jason Shelton <jas.shel...@hotmail.com> > wrote: > > All, > > I am writing to ask if anyone has a quick way of verifying the > contents of a drop down. I have a list of names, and I want to > verify that each name is being displayed in the drop down. Thanks > in advance for all of your help. > > - Shelton > > Windows Liveā¢: Keep your life in sync. See how it works. > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Watir General" group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~----------~----~----~----~------~----~------~--~---