AW: [Webtest] help please

Marc Guillemot Marc Guillemot <mguillemot@yahoo.fr>
Wed, 13 Dec 2006 08:47:32 +0100


Hi,

seems that your js isn't ok for htmlunit. Can you provide the whole 
stack trace you should see on the console?

Marc.

mamtha lalith wrote:
> when i run this test every step gets executed except
> the last clickbutton task.
> And gives the following output in the result file
> - <testresult endtime="Tue Dec 12 10:59:37 "
> location="C:\Canoo\tests\addnewprof.xml:7:"
> starttime="Tue Dec 12 10:59:36 " successful="no"
> testspecname="new Test">
> - <config>
>   <parameter name="protocol" value="http" /> 
>   <parameter name="summary" value="yes" /> 
>   <parameter name="saveresponse" value="yes" /> 
>   <parameter name="timeout" value="300" /> 
>   <parameter name="haltonerror" value="yes" /> 
>   <parameter name="port" value="8080" /> 
>   <parameter name="resultfile" value="untitled.xml" />
> 
>   <parameter name="showhtmlparseroutput" value="no" />
> 
>   <parameter name="resultpath"
> value="C:\Canoo\tests\webtest-results" /> 
>   <parameter name="host" value="localhost" /> 
>   <parameter name="haltonfailure" value="yes" /> 
>   <parameter name="basepath" value="profile" /> 
>   <parameter name="saveprefix" value="response" /> 
>   </config>
> - <results>
> - <step>
>   <parameter name="description" value="start page" /> 
>   <parameter name="resultFilename"
> value="response_1165901377594_invoke.html" /> 
>   <parameter name="taskName" value="invoke" /> 
>   <parameter name="url" value="" /> 
> - <result>
>   <completed duration="1000" /> 
>   </result>
>   </step>
> - <step>
>   <parameter name="description" value="username" /> 
>   <parameter name="name" value="id" /> 
>   <parameter name="taskName" value="setInputField" /> 
>   <parameter name="value" value="a" /> 
> - <result>
>   <completed duration="0" /> 
>   </result>
>   </step>
> - <step>
>   <parameter name="description" value="password" /> 
>   <parameter name="name" value="password" /> 
>   <parameter name="taskName" value="setInputField" /> 
>   <parameter name="value" value="a" /> 
> - <result>
>   <completed duration="0" /> 
>   </result>
>   </step>
> - <step>
>   <parameter name="description" value="Click Submit
> Button" /> 
>   <parameter name="label" value="Sign In" /> 
>   <parameter name="resultFilename"
> value="response_1165901377751_clickButton.html" /> 
>   <parameter name="taskName" value="clickButton" /> 
> - <result>
>   <completed duration="110" /> 
>   </result>
>   </step>
> - <step>
>   <parameter name="description" value="The
> Authenticated Page" /> 
>   <parameter name="taskName" value="verifyText" /> 
>   <parameter name="text" value="Reg" /> 
> - <result>
>   <completed duration="0" /> 
>   </result>
>   </step>
> - <step>
>   <parameter name="description" value="Adding new
> profile" /> 
>   <parameter name="label" value="Add New" /> 
>   <parameter name="resultFilename"
> value="response_1165901377860_clickButton.html" /> 
>   <parameter name="taskName" value="clickButton" /> 
> - <result>
>   <failed duration="125" /> 
>   </result>
>   </step>
>   <failure
> message="com.canoo.webtest.engine.StepFailedException:
> Step[clickButton "Adding new profile" (6/6)]: Script
> error loading page executing webtest at: clickButton
> syntax error (Embedded script in
> http://198.162.18.113:8080/profile/actions/NewProfileFlash?ac=showNewProfile#2)
> Source code: var dates1 =
> /^(?:(((Jan(uary)?|Ma(r(ch)?|y)|Jul(y)?|Aug(ust)?|Oct(ober)?|Dec(ember)?)\
> 31)|((Jan(uary)?|Ma(r(ch)?|y)|Apr(il)?|Ju((ly?)|(ne?))|Aug(ust)?|Oct(ober)?|(Sept|Nov|Dec)(ember)?)\
> (0?[1-9]|([12]\d)|30))|(Feb(ruary)?\
> (0?[1-9]|1\d|2[0-8]|(29(?=,\
> ((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00)))))))\,\
> ((1[6-9]|[2-9]\d)\d{2}))/; var dates2 =
> /(0[0-9]|1[0-2])[/ /]([0-2][0-9]|3[01])[/
> /](19[0-9]{2}|[2][0-9][0-9]{2})/; function
> maxLengthCheck(field,len) { var val=field.value;
> if(val.length>len) { alert("Enter Only "+len+"
> Charectors");
> field.value=field.value.substring(0,len); } } function
> printMode() {
> document.forms[0].action='../jsp/CandidateProfilePDF.jsp';
> document.forms[0].method="POST"
> document.forms[0].submit(); } function addTechExp() {
> var msg1=""; var focus1="";
> for(i=0;i<document.forms[0].elements.length;i++) {
> if(document.forms[0].elements[i].type=="text" &&
> document.forms[0].elements[i].name=="technologyName" )
> { if(document.forms[0].elements[i].value=="" ||
> (!(isNaN([0].addressLine1.value="";
> document.forms[0].addressLine1.focus(); return false;
> } if(document.forms[0].city.value=="") { alert("Please
> Enter value for City");
> document.forms[0].city.value="";
> document.forms[0].city.focus(); return false; }
> if(document.forms[0].city.value!="") { var d2=new
> Array(); d2=document.forms[0].city.value.split('');
> for(i=0;i<d2.length;i++) { for(j=0;j<d1.length;j++) {
> if(d2[i]==d1[j] || d2[i]==j) { flags="false"; } } }
> if(flags=="false") { alert("Entered Valid City.");
> document.forms[0].city.focus(); return false; } }
> if(document.forms[0].state.value=="") { alert("Please
> eneter the State."); document.forms[0].state.value="";
> document.forms[0].state.focus(); return false; }
> if(document.forms[0].state.value!="") { var d2=new
> Array(); d2=document.forms[0].state.value.split('');
> for(i=0;i<d2.length;i++) { for(j=0;j<d1.length;j++) {
> if(d2[i]==d1[j] || d2[i]==j) { flags="false"; } } }
> if(flags=="false") { alert("Entered Valid State.");
> document.forms[0].state.focus(); return false; } }
> if(document.forms[0].zipcode.value=="") {
> alert("Please Enter ZIP");
> document.forms[0].zipcode.value="";
> document.forms[0].zipcode.focus(); return false; }
> if(document.forms[0].zipcode.value!="") { var d2=new
> Array(); d2=document.forms[0].zipcode.value.split('');
> for(i=0;i<d2.length;i++) { for(j=0;j<d1.length;j++) {
> if(d2[i]==d1[j]) { alert("Enter Valid Zip Code.");
> document.forms[0].zipcode.focus(); return false; } } }
> } if(document.forms[0].residencePhone.value=="") {
> alert("Please Enter Residence Phone");
> document.forms[0].residencePhone.value="";
> document.forms[0].residencePhone.focus(); return
> false; }
> if(isNaN(document.forms[0].residencePhone.value)) {
> alert("Please Enter Residence Phone Numbers Only");
> document.forms[0].residencePhone.value="";
> document.forms[0].residencePhone.focus(); return
> false; } if(isNaN(document.forms[0].officePhone.value)
> ||
> document.forms[0[0].elements[i].name=="technicalExperiencePeriod"
> ) { if(isNaN(document.forms[0].elements[i].value)) {
> alert("Enter Numerical Value for Technical Skills.");
> document.forms[0].elements[i].value="";
> document.forms[0].elements[i].focus(); return false; }
> } } }, Step: ClickButton at
> C:\Canoo\tests\addnewprof.xml:16: with
> (resultFilename="response_1165901377860_clickButton.html",
> taskName="clickButton")" /> 
>   </results>
>   </testresult>
> 
> ON CLOSE OOBSERVATION THE ABOVE CODE IS MY HTML SOURCE
> CODE FOR THE NEW PAGE TO BE GENERATED
> 
> --- Michael Habbert <Michael.Habbert@netpioneer.de>
> wrote:
> 
>> Hi you,
>>
>> I would suggest - to give us some more information!
>> [...]
> 
> 
>  
> ____________________________________________________________________________________
> Do you Yahoo!?
> Everyone is raving about the all-new Yahoo! Mail beta.
> http://new.mail.yahoo.com
> _______________________________________________
> WebTest mailing list
> WebTest@lists.canoo.com
> http://lists.canoo.com/mailman/listinfo/webtest
>