From: Joel Pearson Date: 2012-08-03T02:10:15+09:00 Subject: Injecting Javascript into Watir-Webdriver to avoid large objects I'm trying to extract the currently selected value from a dropdown list using webdriver. This process is looped many times per webpage for hundreds of webpages. The problem is, when I use something like this: _____ driver.select_lists(:class => 'iteminput').each do |listy| p "#{listy.value}" end _____ The object is so large that I get a timeout error from webdriver, one of those "Are you sure you want to continue running this script?" dialogues. The problem is that the page is over 5MB, and each listbox contains hundreds of items. I have tried using XPATH and CSS, and looking at the HTML directly, but the HTML doesn't contain the detail of which item is selected. I think my only chance to make this run now is to execute a Javascript command which will return all the currently selected values matching the criteria as a string. The problem is my knowledge of Javascript is virtually nonexistant, so would anyone be able to point me in the right direction, or at least let me know if this is possible? Thanks. -- Posted via http://www.ruby-forum.com/.