Awesome just the advise I'm looking for, thanks for contributing. On Friday, July 12, 2013 9:31:20 PM UTC-5, Justin Ko wrote: > > The "CheckTableUsingRowArray" approach does not seem faster to me. The > location of the timer excludes the Watir portion of the code, which is > costly. In particular, the following line adds about 28 seconds for me: > > myTableArray = obj.to_a #Array the table > > An alternative approach is to use the Nokogiri gem to parse the table. > Zeljko had a good post on the topic - > http://zeljkofilipin.com/watir-nokogiri/ . > > Try the following, which takes about 0.1 seconds: > > #myHash is the same ordered hash used in the other approaches: > myHash = { 'col1' => 'Row30 Content1', 'col2' => 'Row30 Content2', 'col3' > => 'Row30 Content3', 'col4' => 'Row30 Content4', 'col5' => 'Row30 > Content5', 'col6' => 'Row30 Content6', 'col7' => 'Row30 Content7', 'col8' > => 'Row30 Content8' } > myArray = myHash.values > > start = Time.now > obj = ie.table(:id,'table1') > nokogiri = Nokogiri::HTML.parse(obj.html) > nokogiri.css('tr').each_with_index do |tr, i| > if tr.css('td').collect(&:text) == myArray > puts "Row to click: #{i}" > end > end > puts "Time to finish: #{Time.now - start}" > > #Output: > # Row to click 30 > # Time to finish: 0.091 > > - Justin Ko > > > >
-- -- 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 --- You received this message because you are subscribed to the Google Groups "Watir General" group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.