On Jan 8, 9:40 pm, prabhi kumar <prabhian...@gmail.com> wrote: > i have a webpage with many number of ul containing many number of li. > problem is i need to click all li with same class name in all ul. > how can i do it. when i tried browser.li(:class, "tor").click > when i run it it clicks the fir li of first ul but i want to click all > the links
list_items = browser.lis(:class => 'tor') list_items.each do |li| li.click end This presumes that clicking the first item does not cause the page to update in some way, if that's the case this may fail after the first item is clicked, depending on the nature of the update and if the other list items are re-created in the process or not. if something like that is happening we probably need more details to offer you a viable solution -- 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