[Webtest] 404 Not Found for pages running a particular javascript?
Suzanne Scheitle
Suzanne Scheitle <sscheitle@hotmail.com>
Wed, 17 Oct 2007 11:36:11 +0000
--_afcf1f6b-1176-47b9-8d65-51190cfc4294_
Content-Type: text/plain; charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
Hello all - when running a webtest against one particular page that contain=
s a javascript, I get several exceptions. The javascript is pasted at the =
bottom of this email. The errors I get are the following (and of course, t=
he step fails):
Wrapped com.gargoylesoftware.htmlunit.ScriptException: 404 Not Found for ht=
tp://localhost:8080/js/barcode.js (script in http://localhost:8080/cims/act=
iveCaseList.xhtml from (15, 239) to (0, 0)#70)
This script is embedded in the header of my page, so every step trying to a=
ccess this page fails. There's an entire page that I can't test. Is there=
anything I can do to resolve this?
Thanks,
Suzanne
/***** Javascript causing exceptions: *******/
// state keeper, true if we are=20
// currently scanning, otherwise false
var scanning_code =3D false;
var account_number =3D "";
function barcodeHandler(e) {
var accountId =3D document.getElementById('patientCheckInForm:Accou=
nt');
var checkInForm =3D document.getElementById('patientCheckInForm');
if (!e) { // For IE
e =3D window.event;
}
=20
var keyPressed =3D e.charCode || e.keyCode;
if ((keyPressed =3D=3D 221) && (e.ctrlKey)) // start barcode with "=
ctrl-]"
{
window.focus();
scanning_code =3D true;
account_number =3D "";
e.returnValue =3D false;
endEvent( e );
} else if ((keyPressed =3D=3D 13) && scanning_code) { // end barcod=
e with "enter"
scanning_code =3D false;
accountId.value =3D account_number;
e.returnValue =3D false;
endEvent( e );
checkInForm.submit();
} else if (scanning_code &&
(((keyPressed >=3D 48) && (keyPressed <=3D 57)) ||=20
((keyPressed >=3D 65) && (keyPressed <=3D 90)))) { // =
only set field if we are scanning and the values at in [0-9a-zA-Z]
account_number +=3D String.fromCharCode(keyPressed);
e.returnValue =3D false;
endEvent( e );
}
}
function endEvent( e )
{
e.cancelBubble =3D true;
if (e.stopPropagation)
{
e.stopPropagation();
}
}
/ ********* end javascript **********/
_________________________________________________________________
Windows Live Hotmail and Microsoft Office Outlook =96 together at last. =A0=
Get it now.
http://office.microsoft.com/en-us/outlook/HA102225181033.aspx?pid=3DCL10062=
6971033=
--_afcf1f6b-1176-47b9-8d65-51190cfc4294_
Content-Type: text/html; charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class=3D'hmmessage'>
Hello all - when running a webtest against one particular page that contain=
s a javascript, I get several exceptions. The javascript is pasted at=
the bottom of this email. The errors I get are the following (and of=
course, the step fails):<br><br>Wrapped com.gargoylesoftware.htmlunit.Scri=
ptException: 404 Not Found for http://localhost:8080/js/barcode.js (script =
in http://localhost:8080/cims/activeCaseList.xhtml from (15, 239) to (0, 0)=
#70)<br><br>This script is embedded in the header of my page, so every step=
trying to access this page fails. There's an entire page that I can'=
t test. Is there anything I can do to resolve this?<br><br>Thanks,<br=
>Suzanne<br><br>/***** Javascript causing exceptions: *******/<br><br=
> // state keeper, true if we are <br> =
// currently scanning, otherwise false<br> var scanning_c=
ode =3D false;<br> var account_number =3D "";<br><br>&nbs=
p; function barcodeHandler(e) {<br> &nbs=
p; var accountId =3D document.getElementById('patientCheckInFor=
m:Account');<br> var checkInForm =
=3D document.getElementById('patientCheckInForm');<br><br>  =
; if (!e) { // For IE<br> &n=
bsp; e =3D window.event;<br>  =
; }<br> &n=
bsp; <br> var keyPressed =3D e.ch=
arCode || e.keyCode;<br><br> if (=
(keyPressed =3D=3D 221) && (e.ctrlKey)) // start barcode with "ctrl=
-]"<br> {<br> &n=
bsp; window.focus();<br> &nb=
sp; scanning_code =3D=
true;<br>  =
; account_number =3D "";<br>  =
; e.returnValue =3D false;<br> &nb=
sp; endEvent( e );<br>  =
; } else if ((keyPressed =3D=3D 13) && scan=
ning_code) { // end barcode with "enter"<br> &=
nbsp; scanning_code =3D false;<br>  =
; accountId.value =3D=
account_number;<br> &=
nbsp; e.returnValue =3D false;<br>  =
; endEvent( e );<br> &=
nbsp; checkInForm.submit();<br> &n=
bsp; } else if (scanning_code &&<br>&=
nbsp; &nbs=
p; (((keyPressed >=3D 48) &&=
(keyPressed <=3D 57)) || <br> =
&nb=
sp; ((keyPressed >=3D 65) && (keyPressed <=3D 90)))) { // onl=
y set field if we are scanning and the values at in [0-9a-zA-Z]<br> &n=
bsp; account_number +=
=3D String.fromCharCode(keyPressed);<br>  =
; e.returnValue =3D false;<br> &nb=
sp; endEvent( e );<br=
> }<br> }<br><b=
r> function endEvent( e )<br> {<br>&nbs=
p; e.cancelBubble =3D true;<br> &n=
bsp; if (e.stopPropagation)<br> &n=
bsp; {<br>  =
; e.stopPropagation();<br> }<br>&=
nbsp; }<br><br>/ ********* end javascript ***=
*******/<br><br><br><br /><hr />Windows Live Hotmail and Microsoft Office O=
utlook =96 together at last. <a href=3D'http://office.microsoft.com/en-us/o=
utlook/HA102225181033.aspx?pid=3DCL100626971033' target=3D'_new'>Get it now=
!</a></body>
</html>=
--_afcf1f6b-1176-47b9-8d65-51190cfc4294_--