[Celerity-users] Issue with setTimeout and window.location

Ashley Moran ashley.moran at patchspace.co.uk
Thu Jul 16 10:51:45 EDT 2009


On 16 Jul 2009, at 15:36, Andy Shipman wrote:
> It does, however, report:
> com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify


Running a very slightly modified version of the file (against the same  
HTML):

   require 'rubygems'

   gem 'jarib-celerity'
   require 'celerity'

   browser = Celerity::Browser.new
   browser.goto("file://#{File.expand_path(File.dirname(__FILE__))}/ 
timeout.html")

   puts browser.url

   sleep(4)

   puts browser.url

   if browser.text.include?("Search")
     puts "yay"
   else
     puts browser.text
   end

I get:

24> ~/Desktop/celerity % jruby test_timeout.rb
file:/Users/ashleymoran/Desktop/celerity/timeout.html
16-Jul-2009 15:47:18  
com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify
WARNING: Obsolete content type encountered: 'text/javascript'.
file:/Users/ashleymoran/Desktop/celerity/timeout.html
Timeout test
Wait 3 seconds then you'll see Google.


It looks like the new page is being loaded, but Celerity is not  
updating the browser.  Unfortunately, because of the URL not being  
set, you can't use Browser#refresh to trick it into reloading.

Seems like a bug to me.  If so, is there a way of working around it?


Cheers
Ashley


-- 
http://www.patchspace.co.uk/
http://www.linkedin.com/in/ashleymoran
http://aviewfromafar.net/
http://twitter.com/ashleymoran








More information about the Celerity-users mailing list