Hello all - when running a webtest against one particular page that contains 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):

Wrapped com.gargoylesoftware.htmlunit.ScriptException: 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)

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?

Thanks,
Suzanne

/***** Javascript causing exceptions:  *******/

    // state keeper, true if we are 
    // currently scanning, otherwise false
    var scanning_code = false;
    var account_number = "";

    function barcodeHandler(e) {
        var accountId = document.getElementById('patientCheckInForm:Account');
        var checkInForm = document.getElementById('patientCheckInForm');

        if (!e) { // For IE
            e = window.event;
        }
        
        var keyPressed = e.charCode || e.keyCode;

        if ((keyPressed == 221) && (e.ctrlKey)) // start barcode with "ctrl-]"
        {
            window.focus();
            scanning_code = true;
            account_number = "";
            e.returnValue = false;
            endEvent( e );
        } else if ((keyPressed == 13) && scanning_code) { // end barcode with 
"enter"
            scanning_code = false;
            accountId.value = account_number;
            e.returnValue = false;
            endEvent( e );
            checkInForm.submit();
        } else if (scanning_code &&
                    (((keyPressed >= 48) && (keyPressed <= 57)) || 
                     ((keyPressed >= 65) && (keyPressed <= 90)))) { // only set 
field if we are scanning and the values at in [0-9a-zA-Z]
            account_number +=  String.fromCharCode(keyPressed);
            e.returnValue = false;
            endEvent( e );
        }
    }

    function endEvent( e )
    {
        e.cancelBubble = true;
    if (e.stopPropagation)
        {
            e.stopPropagation();
        }
    }

/    ********* end javascript **********/



_________________________________________________________________
Windows Live Hotmail and Microsoft Office Outlook – together at last.  Get it 
now.
http://office.microsoft.com/en-us/outlook/HA102225181033.aspx?pid=CL100626971033

Reply via email to