[Webtest] [webtest][JIRA] Created: (WT-386) Invalid class string error stops test; the indicated error iappears to affect WebTest only

Gordon Page (JIRA) Gordon Page (JIRA)" <noreply@canoo.com
Mon, 11 Feb 2008 23:34:18 +0100 (CET)


Invalid class string error stops test; the indicated error iappears to affe=
ct WebTest only=20
---------------------------------------------------------------------------=
----------------

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

    Versions: 2.5   =20
 Environment: Win XP
    Reporter: Gordon Page


WebTest returns this error:

JavaScript error loading page https://arachne.kingsisle.local/webapp3525/si=
te/wizard: Invalid class string (https://arachne.kingsisle.local/static/352=
5/themes/global/javascript/jquery.js#496)

The details, as reported by WebTest, are:

javascript error=09Invalid class string (https://arachne.kingsisle.local/st=
atic/3525/themes/global/javascript/jquery.js#496)
line=09-1
javascript source=09function () {=20
                                          var val;=20
                                          if (typeof jQuery =3D=3D "undefin=
ed" || jQuery.event.triggered) {=20
                                              return val;=20
                                          }=20
                                          val =3D jQuery.event.handle.apply=
(element, arguments);=20
                                          return val;=20
                                      }
failing line=09<no source>
javascript call stack=09Invalid class string (https://arachne.kingsisle.loc=
al/static/3525/themes/global/javascript/jquery.js#496) at (https://arachne.=
kingsisle.local/static/3525/themes/global/javascript/jquery.js:496) at eval=
Script(https://arachne.kingsisle.local/static/3525/themes/global/javascript=
/jquery.js:416) at (https://arachne.kingsisle.local/static/3525/themes/glob=
al/javascript/jquery.js:584) at evalScript(https://arachne.kingsisle.local/=
static/3525/themes/global/javascript/jquery.js:422) at (https://arachne.kin=
gsisle.local/static/3525/themes/global/javascript/jquery.js:402) at (https:=
//arachne.kingsisle.local/static/3525/themes/global/javascript/jquery.js:58=
4) at (https://arachne.kingsisle.local/static/3525/themes/global/javascript=
/jquery.js:400) at (https://arachne.kingsisle.local/static/3525/themes/glob=
al/javascript/jquery.js:584) at (https://arachne.kingsisle.local/static/352=
5/themes/global/javascript/jquery.js:1076) at (https://arachne.kingsisle.lo=
cal/static/3525/themes/global/javascript/jquery.js:584) at (https://arachne=
.kingsisle.local/static/3525/themes/global/javascript/jquery.js:652) at (ht=
tps://arachne.kingsisle.local/static/3525/themes/global/javascript/jquery.j=
s:633) at (https://arachne.kingsisle.local/static/3525/themes/global/javasc=
ript/jquery.js:647) at (https://arachne.kingsisle.local/static/3525/themes/=
global/javascript/jquery.js:2760) at (https://arachne.kingsisle.local/stati=
c/3525/themes/global/javascript/jquery.js:2803) at (https://arachne.kingsis=
le.local/static/3525/themes/global/javascript/jquery.js:2603) at (https://a=
rachne.kingsisle.local/static/3525/themes/global/javascript/jquery.js:582) =
at (https://arachne.kingsisle.local/static/3525/themes/global/javascript/jq=
uery.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.loca=
l/static/3525/themes/wizard101/global/javascript/readyLoad.js:91) at (https=
://arachne.kingsisle.local/static/3525/themes/global/javascript/jquery.js:1=
776) at (https://arachne.kingsisle.local/static/3525/themes/global/javascri=
pt/jquery.js:1620)

My script is:

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

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

=09<import file=3D"../definitions.xml"/>
=09<property description=3D"get SSL keystore" file=3D"../../common/includes=
/keystore.property" />
=09<property description=3D"get  user info" file=3D"../includes/user.proper=
ty" />

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

                                        <!-- snipped comments -->

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

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

=09=09=09=09=09<!-- enter credit card info if plan level is not Beta or Fre=
e -->

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

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

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

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

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

If the error is occurring because val is undefined it appears WebTest is do=
ing so prematurely; the function is defined to return val as either false o=
f 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 Explor=
er?  It appears to have no bearing on the functioning of our app (and proba=
bly many others which use JQuery).

--=20
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