[Webtest] javascript interpreter problem. But it works on IE an Netscape.

Bill Milbratz webtest@lists.canoo.com
Thu, 15 May 2003 12:00:04 -0500


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------=_NextPartTM-000-b3097d83-06dd-48c6-b228-977b835d471b
Content-Type: multipart/alternative;
	boundary="----_=_NextPart_001_01C31B03.6E540DC0"

------_=_NextPart_001_01C31B03.6E540DC0
Content-Type: text/plain;
	charset="iso-8859-1"

Hi,

I'm brand new to webtest and just getting started running basic testing on
our site. Nice product! I look forward to using it.

Immediately I came across a javascript problem. It appears that the HttpUnit
javascript interpreter isn't as forgiving as either IE's or Mozillas and
throws an exception during testing.

One example was  a variable that wasn't declared using correctly:

instead of 
  var myVar = 'foo';

the bad javascript had:
   myVar = 'foo';

In another example, a function call died:
<script type="text/javascript">
   cookieCheck();
</script>

though it appeared to be defined correctly above.


I don't know if what hidden javascript errors lurk beneath our site. Does
anyone have a means to find these errors w/ a browser or some 'ecmascript
validator' ? or is this an httpunit problem?

thanks,

bill m


example exception:

   }' failed: org.mozilla.javascript.EvaluatorException: The undefined value
has no properti
es. (httpunit; line 69)
        at
com.meterware.httpunit.javascript.JavaScript$JavaScriptEngine.handleScriptEx
cepti
on(JavaScript.java:191)
        at
com.meterware.httpunit.javascript.JavaScript$JavaScriptEngine.executeScript(
JavaS
cript.java:126)
        at
com.meterware.httpunit.scripting.ScriptableDelegate.runScript(ScriptableDele
gate.
java:61)
        at
com.meterware.httpunit.ParsedHTML.interpretScriptElement(ParsedHTML.java:204
)
        at com.meterware.httpunit.ParsedHTML.access$600(ParsedHTML.java:35)
        at
com.meterware.httpunit.ParsedHTML$ScriptFactory.recordElement(ParsedHTML.jav
a:333
)
        at
com.meterware.httpunit.ParsedHTML$2.processElement(ParsedHTML.java:485)
        at
com.meterware.httpunit.NodeUtils$PreOrderTraversal.perform(NodeUtils.java:16
9)
        at
com.meterware.httpunit.ParsedHTML.loadElements(ParsedHTML.java:495)
        at com.meterware.httpunit.ParsedHTML.getForms(ParsedHTML.java:94)
        at
com.meterware.httpunit.WebResponse$Scriptable.load(WebResponse.java:567)

------_=_NextPart_001_01C31B03.6E540DC0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2653.12">
<TITLE>javascript interpreter problem. But it works on IE an =
Netscape.</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=3D2 FACE=3D"Arial">Hi,</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">I'm brand new to webtest and just =
getting started running basic testing on our site. Nice product! I look =
forward to using it.</FONT></P>

<P><FONT SIZE=3D2 FACE=3D"Arial">Immediately I came across a javascript =
problem. It appears that the HttpUnit javascript interpreter isn't as =
forgiving as either IE's or Mozillas and throws an exception during =
testing.</FONT></P>
<BR>

<P><FONT SIZE=3D2 FACE=3D"Arial">One example was&nbsp; a variable that =
wasn't declared using correctly:</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">instead of </FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp; var myVar =3D 'foo';</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">the bad javascript had:</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp; myVar =3D 'foo';</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">In another example, a function call =
died:</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">&lt;script =
type=3D&quot;text/javascript&quot;&gt;</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp; cookieCheck();</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">&lt;/script&gt;</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">though it appeared to be defined =
correctly above.</FONT>
</P>
<BR>

<P><FONT SIZE=3D2 FACE=3D"Arial">I don't know if what hidden javascript =
errors lurk beneath our site. Does anyone have a means to find these =
errors w/ a browser or some 'ecmascript validator' ? or is this an =
httpunit problem?</FONT></P>

<P><FONT SIZE=3D2 FACE=3D"Arial">thanks,</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">bill m</FONT>
</P>
<BR>

<P><FONT SIZE=3D2 FACE=3D"Arial">example exception:</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp; }' failed: =
org.mozilla.javascript.EvaluatorException: The undefined value has no =
properti</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">es. (httpunit; line 69)</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at =
com.meterware.httpunit.javascript.JavaScript$JavaScriptEngine.handleScri=
ptExcepti</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">on(JavaScript.java:191)</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at =
com.meterware.httpunit.javascript.JavaScript$JavaScriptEngine.executeScr=
ipt(JavaS</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">cript.java:126)</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at =
com.meterware.httpunit.scripting.ScriptableDelegate.runScript(Scriptable=
Delegate.</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">java:61)</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at =
com.meterware.httpunit.ParsedHTML.interpretScriptElement(ParsedHTML.java=
:204)</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at =
com.meterware.httpunit.ParsedHTML.access$600(ParsedHTML.java:35)</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at =
com.meterware.httpunit.ParsedHTML$ScriptFactory.recordElement(ParsedHTML=
.java:333</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">)</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at =
com.meterware.httpunit.ParsedHTML$2.processElement(ParsedHTML.java:485)<=
/FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at =
com.meterware.httpunit.NodeUtils$PreOrderTraversal.perform(NodeUtils.jav=
a:169)</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at =
com.meterware.httpunit.ParsedHTML.loadElements(ParsedHTML.java:495)</FON=
T>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at =
com.meterware.httpunit.ParsedHTML.getForms(ParsedHTML.java:94)</FONT>
<BR><FONT SIZE=3D2 =
FACE=3D"Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at =
com.meterware.httpunit.WebResponse$Scriptable.load(WebResponse.java:567)=
</FONT>
</P>

</BODY>
</HTML>
------_=_NextPart_001_01C31B03.6E540DC0--

------=_NextPartTM-000-b3097d83-06dd-48c6-b228-977b835d471b--