[Celerity-users] Logger / js output for Rails and Culerity

Jari Bakken jari.bakken at gmail.com
Tue Jun 9 17:28:10 EDT 2009


On 9. juni. 2009, at 20.27, Dinshaw Gobhai wrote:

> Is there a way to do do some js debugging in a celerity session?
> I found the HtmlUnit log docs but don't really see how to use it  
> through Rails and Culerity.

My best suggestion is using alert() and in your Ruby code do

   browser.add_listener(:alert) { |page, message| ... }

That will probably get quite annoying when browsing the app manually  
though. It would be great to be able to do console.debug(...) in  
JavaScript and have HtmlUnit expose that log somewhere. However, http://htmlunit.sourceforge.net/javascript.html 
  says:

> Testing pages with JavaScript on them can produce a number of  
> errors. These errors occur for several reasons. Some browsers accept  
> shortcuts that are not part of the DOM model and currently not  
> duplicated by HtmlUnit. Also, HtmlUnit still does not implement all  
> of the extensions that have been added by the different browsers.

If you can convince someone to add the console object to HtmlUnit's JS  
implementation, I'll be happy to add support for it in Celerity. Their  
mailing lists are at http://htmlunit.sourceforge.net/mail-lists.html :)




More information about the Celerity-users mailing list