[Helma-user] Server-side DOM
Michael Platzer
michael.platzer at knallgrau.at
Wed Jul 11 12:10:59 CEST 2007
Hi,
We have been using the prototype.js on the server-side since over a year
now, but we always had to strip out the dom-related parts before
dropping it into the code-repository. That is a tempting and impressive
idea, to try to just simulate the window/dom on the server-side.
But for running automated controller-tests, this doesn't bring that much
comfort compared to what jala already provides, does it?
Currently I can write
var httpClient = new jala.Test.HttpClient();
var result = httpClient.getUrl(someUrl);
var doc = new jala.HtmlDocument(result.content);
var ele = doc.scrape("//html:img[@id='captchaImage']"); //
XPath-expression
With env.js and prototype.js I could write
window.location = someUrl;
var ele = $("img.captchaImge");
But a lot of questions remain, like how would i simulate multiple
clients, or how can we support sessions, resp cookies?
Anyways, interesting article, thanks for the pointer!
michi
p.s. looking at the above sample code, i would even simply suggest
adding methods '$' and '$$' to the jala.HtmlDocument. I don't think that
it would be that hard to implement these, since these are just simple
wrappers for the scrape-method?
Maksim Lin for technical support mailling lists schrieb:
> I came across this on John Resigs blog and it looks like at the very
> least it would be useful for doing testing of helma apps within helma
> along the lines of whats currently provided in Jala...
>
> http://ejohn.org/blog/bringing-the-browser-to-the-server/
> _______________________________________________
> Helma-user mailing list
> Helma-user at helma.org
> http://helma.org/mailman/listinfo/helma-user
More information about the Helma-user
mailing list