Well it appears from the OP error that the return object 
of Browser#execute_script is a WebDriver::Element.. hence my code is 
failing as it expects a hash.

I'm not sure why this is doing it on Win2K8 R2 with IE9, as I don't have 
that development platform... but it was tested on Win2K3 with IE9 as Chuck 
mentioned.

I could just raise an error like Jari suggested, but that won't help the 
outcome (getting navigation timings).

We *could* just monkey patch the execute_script method, but before I do, 
Jari, is there a more elegant solution?

module Watir
 class Browser
  def execute_script(script, *args)
   args.map! { |e| e.kind_of?(Watir::Element) ? e.wd : e }
   obj = @driver.execute_script(script, *args)
   obj.each { |k,v| obj[k] = wrap_elements_in(v) }
   obj
  end
 end
end

-- 
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

Reply via email to