[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.&nbsp; The javascript is pasted at=
 the bottom of this email.&nbsp; 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.&nbsp; There's an entire page that I can'=
t test.&nbsp; Is there anything I can do to resolve this?<br><br>Thanks,<br=
>Suzanne<br><br>/***** Javascript causing exceptions:&nbsp; *******/<br><br=
>&nbsp;&nbsp;&nbsp; // state keeper, true if we are <br>&nbsp;&nbsp;&nbsp; =
// currently scanning, otherwise false<br>&nbsp;&nbsp;&nbsp; var scanning_c=
ode =3D false;<br>&nbsp;&nbsp;&nbsp; var account_number =3D "";<br><br>&nbs=
p;&nbsp;&nbsp; function barcodeHandler(e) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp; var accountId =3D document.getElementById('patientCheckInFor=
m:Account');<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var checkInForm =
=3D document.getElementById('patientCheckInForm');<br><br>&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp; if (!e) { // For IE<br>&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; e =3D window.event;<br>&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var keyPressed =3D e.ch=
arCode || e.keyCode;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (=
(keyPressed =3D=3D 221) &amp;&amp; (e.ctrlKey)) // start barcode with "ctrl=
-]"<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; window.focus();<br>&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; scanning_code =3D=
 true;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
; account_number =3D "";<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp; e.returnValue =3D false;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; endEvent( e );<br>&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp; } else if ((keyPressed =3D=3D 13) &amp;&amp; scan=
ning_code) { // end barcode with "enter"<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; scanning_code =3D false;<br>&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; accountId.value =3D=
 account_number;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp; e.returnValue =3D false;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; endEvent( e );<br>&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; checkInForm.submit();<br>&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } else if (scanning_code &amp;&amp;<br>&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (((keyPressed &gt;=3D 48) &amp;&amp;=
 (keyPressed &lt;=3D 57)) || <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp; ((keyPressed &gt;=3D 65) &amp;&amp; (keyPressed &lt;=3D 90)))) { // onl=
y set field if we are scanning and the values at in [0-9a-zA-Z]<br>&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; account_number +=
=3D&nbsp; String.fromCharCode(keyPressed);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; e.returnValue =3D false;<br>&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; endEvent( e );<br=
>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }<br><b=
r>&nbsp;&nbsp;&nbsp; function endEvent( e )<br>&nbsp;&nbsp;&nbsp; {<br>&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; e.cancelBubble =3D true;<br>&nbsp;&n=
bsp;&nbsp; if (e.stopPropagation)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
; e.stopPropagation();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&=
nbsp;&nbsp;&nbsp; }<br><br>/&nbsp;&nbsp;&nbsp; ********* 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_--