[wtr-general] Re: Accessing an unordered list

2011-04-07 Thread Adam Reed
Hi Anne, The reason you're getting that error is that you're using lis rather than li in your code. This is like saying browser.images, as in browser.images.each do |img|... To reach a singular element, you want to use the singular locator. Also, while you are certainly able to click on an li

[wtr-general] Re: Accessing an unordered list

2011-04-07 Thread Chuck van der Linden
The ID 'abc/123' belongs to a element of type link.. to click on it browser.link(:id, abc/123).click Assuming you did not know the ID of that item, and wanted to always click the first list item inside the resultList, then you could do browser.div(:id, 'resultList').li(:index, 1).click

[wtr-general] Re: Accessing an unordered list

2011-04-07 Thread Anne
Thanks, everyone, for all the great info. I'll try your suggestions and let you know how it goes. -- 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

[wtr-general] Re: Accessing an unordered list

2011-04-07 Thread Anne
Thanks to all of you... it's working... If I ever get a chance to meet you guys at a conference, I owe you each a drink... or a giant chocolate chip cookie... On Apr 7, 11:14 am, Anne annemordk...@gmail.com wrote: Thanks, everyone, for all the great info.  I'll try your suggestions and let

[wtr-general] Re: Accessing an unordered list

2011-04-07 Thread marko
Hi Anne, what Keith said. The methods with the plural form (lis, images, divs etc.) return an array of elements and you cannot click on an array. You need to find a specific element and then click on it as Keith suggested with the li method in this case. Alternatively you can use the plural