[Webtest] Script error

Jon Poulton [kinomi] webtest@lists.canoo.com
Thu, 13 Apr 2006 13:09:34 +0100


This is a multi-part message in MIME format.

------=_NextPart_000_0039_01C65EFB.82B6D420
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit

Well, I'm a step closer to finding out what's going on. Part of the error
message refers to a line number/variable name in this script:

 

http://jquery.com/src/latest/ajax-event-fx-jquery-latest/

 

Line 741 in function fixEvent() tries to set a variable like this:

 

            event.preventDefault = fixEvent.preventDefault;

 

Perhaps the error message "Cannot set property 'preventDefault' of null"
means that the "event" variable is null? Why would this be the case? 

 

Jon

 

  _____  

From: webtest-admin@gate2.canoo.com [mailto:webtest-admin@gate2.canoo.com]
On Behalf Of Jon Poulton [kinomi]
Sent: 13 April 2006 12:45
To: webtest@gate2.canoo.com
Subject: [Webtest] Script error

 

One of our web developers has made some changes to our web application,
which includes moving some Javascript into separate files. For some reason
this has caused my Canoo tests to fail with an error message I have never
seen before. I do not know what the error message means, or how to diagnose
the problem further. The error from the log below reads: 

 

"ScriptException: enclosed exception was "TypeError: Cannot set property
"preventDefault" of null to
"org.mozilla.javascript.InterpretedFunction@278e83"
(http://localhost:8080/cks/scripts/jquery.js#741)".

 

I have seen a fair number of script exception problems on this mailing list,
but I've never had a problem with them before. Any help would be
appreciated.

 

..

 [testSpec] (steps.Step                          322 ) >>>> Start Step:
invoke "Get Group add Page." (7/28)

 [testSpec] (request.AbstractTargetAction        105 ) -> gotoTarget by URL:
groups/add

 [testSpec] (request.TargetHelper                64  ) getting response for
url: http://localhost:8080/cks/groups/add

 [testSpec] (request.TargetHelper                94  ) ScriptException:
enclosed exception was "TypeError: Cannot set property "preventDefault" of
null to "org.mozilla.javascript.InterpretedFunction@278e83"
(http://localhost:8080/cks/scripts/jquery.js#741)"

 [testSpec] (steps.Step                          556 ) Exception thrown from
this class: com.canoo.webtest.engine.StepFailedException

 [testSpec] (steps.Step                          558 ) Message was:
Step[invoke "Get Group add Page." (7/28)]: Script error executing at: invoke

...

 

Jon 


------=_NextPart_000_0039_01C65EFB.82B6D420
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" =
xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:st1=3D"urn:schemas-microsoft-com:office:smarttags" =
xmlns=3D"http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
 namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags" =
name=3D"PersonName"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
	{font-family:Tahoma;
	panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman";}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;
	text-decoration:underline;}
span.EmailStyle17
	{mso-style-type:personal;
	font-family:Arial;
	color:windowtext;}
span.EmailStyle18
	{mso-style-type:personal-reply;
	font-family:Arial;
	color:navy;}
@page Section1
	{size:595.3pt 841.9pt;
	margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
	{page:Section1;}
-->
</style>

</head>

<body lang=3DEN-US link=3Dblue vlink=3Dpurple>

<div class=3DSection1>

<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'>Well, I&#8217;m a step closer to =
finding
out what&#8217;s going on. Part of the error message refers to a line
number/variable name in this script:<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'><a
href=3D"http://jquery.com/src/latest/ajax-event-fx-jquery-latest/">http:/=
/jquery.com/src/latest/ajax-event-fx-jquery-latest/</a><o:p></o:p></span>=
</font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'>Line 741 in function fixEvent() =
tries to
set a variable like this:<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; event.preventDefault
=3D fixEvent.preventDefault;<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'>Perhaps the error message =
&#8220;</span></font><font
size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:10.0pt;font-family:Arial'>Cannot
set property &#8216;preventDefault&#8217; of null</span></font><font =
size=3D2
color=3Dnavy face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial;
color:navy'>&#8221; means that the &#8220;event&#8221; variable is null? =
Why
would this be the case? <o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'>Jon<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span =
style=3D'font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<div>

<div class=3DMsoNormal align=3Dcenter style=3D'text-align:center'><font =
size=3D3
face=3D"Times New Roman"><span style=3D'font-size:12.0pt'>

<hr size=3D2 width=3D"100%" align=3Dcenter tabindex=3D-1>

</span></font></div>

<p class=3DMsoNormal><b><font size=3D2 face=3DTahoma><span =
style=3D'font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font =
size=3D2
face=3DTahoma><span style=3D'font-size:10.0pt;font-family:Tahoma'>
webtest-admin@gate2.canoo.com [mailto:webtest-admin@gate2.canoo.com] =
<b><span
style=3D'font-weight:bold'>On Behalf Of </span></b>Jon Poulton =
[kinomi]<br>
<b><span style=3D'font-weight:bold'>Sent:</span></b> 13 April 2006 =
12:45<br>
<b><span style=3D'font-weight:bold'>To:</span></b> <st1:PersonName =
w:st=3D"on">webtest@gate2.canoo.com</st1:PersonName><br>
<st1:PersonName w:st=3D"on"><b><span =
style=3D'font-weight:bold'>Su</span></b></st1:PersonName><b><span
style=3D'font-weight:bold'>bject:</span></b> [Webtest] Script =
error</span></font><o:p></o:p></p>

</div>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial'>One of our web developers has made some =
changes to
our web application, which includes moving some Javascript into separate =
files.
For some reason this has caused my Canoo tests to fail with an error =
message I
have never seen before. I do not know what the error message means, or =
how to
diagnose the problem further. The error from the log below reads: =
<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial'>&#8220;ScriptException: enclosed exception was
&quot;TypeError: Cannot set property &quot;preventDefault&quot; of null =
to
&quot;org.mozilla.javascript.InterpretedFunction@278e83&quot; (<a
href=3D"http://localhost:8080/cks/scripts/jquery.js#741)">http://localhos=
t:8080/cks/scripts/jquery.js#741)</a>&quot;.<o:p></o:p></span></font></p>=


<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial'>I have seen a fair number of script exception
problems on this mailing list, but I&#8217;ve never had a problem with =
them before.
Any help would be appreciated.<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial'>&#8230;&#8230;<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial'>&nbsp;[testSpec]
(steps.Step&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;
322 ) &gt;&gt;&gt;&gt; Start Step: invoke &quot;Get Group add =
Page.&quot; (7/28)<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial'>&nbsp;[testSpec]
(request.AbstractTargetAction&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
105 )
-&gt; gotoTarget by URL: groups/add<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial'>&nbsp;[testSpec] =
(request.TargetHelper&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
64&nbsp; ) getting response for url: =
http://localhost:8080/cks/groups/add<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial'>&nbsp;[testSpec]
(request.TargetHelper&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
94&nbsp; ) ScriptException: enclosed exception was &quot;TypeError: =
Cannot set
property &quot;preventDefault&quot; of null to =
&quot;org.mozilla.javascript.InterpretedFunction@278e83&quot;
(http://localhost:8080/cks/scripts/jquery.js#741)&quot;<o:p></o:p></span>=
</font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial'>&nbsp;[testSpec]
(steps.Step&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;
556 ) Exception thrown from this class: =
com.canoo.webtest.engine.StepFailedException<o:p></o:p></span></font></p>=


<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial'>&nbsp;[testSpec]
(steps.Step&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;
558 ) Message was: Step[invoke &quot;Get Group add Page.&quot; (7/28)]: =
Script
error executing at: invoke<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial'>&#8230;&#8230;.<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-GB =
style=3D'font-size:
10.0pt;font-family:Arial'>Jon <o:p></o:p></span></font></p>

</div>

</body>

</html>

------=_NextPart_000_0039_01C65EFB.82B6D420--