[Webtest] java script error i do not see in any browser

Marc Guillemot Marc Guillemot <mguillemot@yahoo.fr>
Tue, 09 Sep 2008 13:02:01 +0200


Hi,

the explanation is probably that the js code is not yet supported by
HtmlUnit. If you can provide a publicly available example, I could
perhaps tell more.

Cheers,
Marc.
-- 
Blog: http://mguillem.wordpress.com

Søren Krum wrote:
> When testing some of my pages i want to set one of the options of a
> select on a page, but trying to do so via webtest causes a java script
> error to be thrown. That is a kind of strange because neither the
> Internet explorer nor the firefox produces an error on this page.
> 
> Anyone who has a good idea about the reason?
> 
> May be of some help: The error message the run produces is :
> 
> JavaScript error loading page https://myside/portal/forms/aksessliste/:
> TypeError: Cannot read property "body" from undefined
> (https://myside/_cocoon/resources/forms/htmlarea/htmlarea.js#1733)
> 
> and the method in js lokks like that:
> 
> HTMLArea.prototype.getHTML = function() {
>   switch (this._editMode) {
>       case "wysiwyg"  :
>       if (!this.config.fullPage) {
>           return HTMLArea.getHTML(this._doc.body, false, this); // this
> is the line 1733
>       } else
>           return this.doctype + "\n" +
> HTMLArea.getHTML(this._doc.documentElement, true, this);
>       case "textmode" : return this._textArea.value;
>       default        : alert("Mode <" + mode + "> not defined!");
>   }
>   return false;
> };
> 
> Do i have a problems of versions of js? Or is it just a version of js
> which is to new for the interpreter? The description of the HTMLArea
> (the js is part of it) says that it works for IE 5.5 or newer, Mozilla
> 1.3 (or newer) and gecko.
> 
> Kind regards
> 
> Søren Krum
>