Hi,

the approach of this blog post is far too simplistic: it is not that
easy to achieve a good browser simulation.

In HtmlUnit, we're able to reproduce the behavior of the "big" browsers
on a large number of AJAX libraries. This requires (among others) to
modify Rhino's behavior at different places.

Concerning prototype, the fidelity of HtmlUnit's simulation is quite
good but we're still not able to have all their unit tests passing as we
do for other libraries like JQuery, MooTools, ... Nevertheless I imagine
that HtmlUnit can already be far better for you than pure Rhino or than
John's hack.

Cheers,
Marc.
-- 
Web: http://www.efficient-webtesting.com
Blog: http://mguillem.wordpress.com


Owen Densmore wrote:
> Sorry if this is too noob, but I'm having difficulty using Prototype
> with Rhino.  When I load the Prototype.js file, I get and exception:
>   uncaught JavaScript runtime exception: ReferenceError:
>   "window" is not defined
> 
> I'm looking at using JS outside of a browser, but still using
> libraries like jQuery and Prototype.  I looked at this article:
>   http://ejohn.org/projects/bringing-the-browser-to-the-server/
> .. and tried
> 
> load('/Users/owen/local/env-js/src/env.js');
> window.location = '/Users/owen/src/web/helloworld.html';
> load('/Users/owen/local/prototype-1.6.0.3.js');
> ..which resulted in an error:
> "/Users/owen/local/prototype-1.6.0.3.js", line 108: uncaught
> JavaScript runtime exception: TypeError: Cannot set property
> "isLeftClick" of undefined to
> "org.mozilla.javascript.interpretedfunct...@61f533"
> 
> I gotta believe its possible to use javascript libraries with rhino,
> so clearly I'm doing something silly!
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino

Reply via email to