Invalid class string error stops test; the indicated error iappears to affect 
WebTest only 
-------------------------------------------------------------------------------------------

         Key: WT-386
         URL: http://webtest-community.canoo.com/jira/browse/WT-386
     Project: WebTest
        Type: Bug

    Versions: 2.5    
 Environment: Win XP
    Reporter: Gordon Page


WebTest returns this error:

JavaScript error loading page 
https://arachne.kingsisle.local/webapp3525/site/wizard: Invalid class string 
(https://arachne.kingsisle.local/static/3525/themes/global/javascript/jquery.js#496)

The details, as reported by WebTest, are:

javascript error        Invalid class string 
(https://arachne.kingsisle.local/static/3525/themes/global/javascript/jquery.js#496)
line    -1
javascript source       function () { 
                                          var val; 
                                          if (typeof jQuery == "undefined" || 
jQuery.event.triggered) { 
                                              return val; 
                                          } 
                                          val = 
jQuery.event.handle.apply(element, arguments); 
                                          return val; 
                                      }
failing line    <no source>
javascript call stack   Invalid class string 
(https://arachne.kingsisle.local/static/3525/themes/global/javascript/jquery.js#496)
 at 
(https://arachne.kingsisle.local/static/3525/themes/global/javascript/jquery.js:496)
 at 
evalScript(https://arachne.kingsisle.local/static/3525/themes/global/javascript/jquery.js:416)
 at 
(https://arachne.kingsisle.local/static/3525/themes/global/javascript/jquery.js:584)
 at 
evalScript(https://arachne.kingsisle.local/static/3525/themes/global/javascript/jquery.js:422)
 at 
(https://arachne.kingsisle.local/static/3525/themes/global/javascript/jquery.js:402)
 at 
(https://arachne.kingsisle.local/static/3525/themes/global/javascript/jquery.js:584)
 at 
(https://arachne.kingsisle.local/static/3525/themes/global/javascript/jquery.js:400)
 at 
(https://arachne.kingsisle.local/static/3525/themes/global/javascript/jquery.js:584)
 at 
(https://arachne.kingsisle.local/static/3525/themes/global/javascript/jquery.js:1076)
 at 
(https://arachne.kingsisle.local/static/3525/themes/global/javascript/jquery.js:584)
 at 
(https://arachne.kingsisle.local/static/3525/themes/global/javascript/jquery.js:652)
 at 
(https://arachne.kingsisle.local/static/3525/themes/global/javascript/jquery.js:633)
 at 
(https://arachne.kingsisle.local/static/3525/themes/global/javascript/jquery.js:647)
 at 
(https://arachne.kingsisle.local/static/3525/themes/global/javascript/jquery.js:2760)
 at 
(https://arachne.kingsisle.local/static/3525/themes/global/javascript/jquery.js:2803)
 at 
(https://arachne.kingsisle.local/static/3525/themes/global/javascript/jquery.js:2603)
 at 
(https://arachne.kingsisle.local/static/3525/themes/global/javascript/jquery.js:582)
 at 
(https://arachne.kingsisle.local/static/3525/themes/global/javascript/jquery.js:2599)
 at 
(https://arachne.kingsisle.local/static/3525/themes/global/javascript/jquery.js:2650)
 at 
(https://arachne.kingsisle.local/static/3525/themes/global/javascript/jquery.js:584)
 at 
(https://arachne.kingsisle.local/static/3525/themes/wizard101/global/javascript/readyLoad.js:91)
 at 
(https://arachne.kingsisle.local/static/3525/themes/global/javascript/jquery.js:1776)
 at 
(https://arachne.kingsisle.local/static/3525/themes/global/javascript/jquery.js:1620)

My script is:

<!DOCTYPE project SYSTEM "../dtd/Project.dtd"[
]>

<project name="wiz.CreateAccount" basedir="." default="test">

        <import file="../definitions.xml"/>
        <property description="get SSL keystore" 
file="../../common/includes/keystore.property" />
        <property description="get  user info" file="../includes/user.property" 
/>

        &secretFieldCount;
        <target name="test" depends="wt.defineMacros">
                <dataDriven tableContainer="../../data/CreateAccount.xls">
                        <webtest name="Wizard Create Account">
                                &config;
                                <steps>
                                        <!-- Set up to create an account -->
                                        <invoke url="/site/wizard" 
description="launch Wizard web site"/>

                                        <!-- snipped comments -->

                                        <clickElement htmlId="menu1" 
description="click side banner to expose menu"/>     <!-- error occurs on this 
line -->
                                        <clickLink label="Sign Up Now!" 
description="click link to invoke create account"/>
                                        
                                        <verifyTitle text="Registration" 
description="we should see the registration title" />
                                                
                                        <!-- Click Agree to accept terms -->
                                        <clickButton description="click Agree" 
                                                htmlId="buttonAgree"/>
                                                
                                        <group description="enter names, email, 
username, password, and validate password">
                                                &enterNameFields;
                                                &enterUsernamePasswordFields;
                                                <clickButton description="click 
Next button" 
                                                htmlId="buttonNext"/>
                                        </group>

                                        <group description="enter contact and 
personal information">
                                                &enterContactInfo;
                                                &enterPersonalInfo;
                                                <clickButton description="click 
Next button" 
                                                        htmlId="buttonNext"/>
                                        </group>
                                                
                                        <group description="select the plan 
level">
                                                <setSelectField 
description="Select the plan level" 
                                                        htmlId="planLevel" 
                                                        
value="${strPlanLevel}"/>
                                                <clickButton description="click 
Next button" 
                                                        htmlId="buttonNext"/>
                                        </group>

                                        <!-- enter credit card info if plan 
level is not Beta or Free -->

                                        <group description="enter secret 
question info">
                                                &enterSecretQuestions;
                                                <clickButton description="click 
Next button" 
                                                        htmlId="buttonNext"/>
                                        </group>
                                                
                                        <group description="get direct x info">
                                                <setFileField 
description="enter the path to the dxdiag file" 
                                                        htmlId="uploadedFile" 
                                                        
fileName="${strDxdiag}"/>
                                                <clickButton description="click 
Next button" 
                                                        htmlId="buttonNext"/>
                                        </group>
                                        
                                        <group description="set captcha info">
                                                <setInputField description="Set 
the captcha value" 
                                                        htmlId="captcha" 
                                                        value="${strCaptcha}"/>
                                                <verifyInputField 
description="make sure the text is in the field" 
                                                        htmlId="captcha" 
                                                        value="${strCaptcha}"/>
                                                <clickButton description="click 
Submit button" htmlId="buttonSubmit"/>
                                        </group>                                
                

                                        <!-- verify we get expected form title 
and message -->
                                        <verifyTitle description="we should see 
the complete account registration title" 
                                                text="Complete Account 
Registration" />
                                        <verifyText description="verify the 
completion message is displayed"
                                                text="Registration is complete. 
 Thank you for registering with us.  We will notify you that your account has 
been activated."/>
                                </steps>
                        </webtest>
                </dataDriven>
        </target>
</project>

The error occurs in JQuery (http://jquery.com/) code, we have no control over 
it.  The section of code in jquery.js where the error occurs is:

// Init the element's event structure
 var events = jQuery.data(element, "events") || jQuery.data(element, "events", 
{});

 var handle = jQuery.data(element, "handle", function(){
     // returned undefined or false
     var val;
 
     // Handle the second event of a trigger and when
     // an event is called after a page has unloaded
     if ( typeof jQuery == "undefined" || jQuery.event.triggered )
         return val;
 
     val = jQuery.event.handle.apply(element, arguments);
 
     return val;
 });

If the error is occurring because val is undefined it appears WebTest is doing 
so prematurely; the function is defined to return val as either false of 
undefined.

This error does not occur in or is not captured by Firefox's error console or 
Firebug or Internet Explorer 7.0 debug.

Is this a defect in WebTest?  If not, is there any way to force WebTest to 
ignore this error or treat it as does Firefox, Firebug, and Internet Explorer?  
It appears to have no bearing on the functioning of our app (and probably many 
others which use JQuery).

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://webtest-community.canoo.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest

Reply via email to