[Webtest] javascript form submittal

Lisa Crispin webtest@lists.canoo.com
Tue, 14 Dec 2004 00:23:09 +0000


--NextPart_Webmail_9m3u9jl4l_26226_1102983789_0
Content-Type: text/plain
Content-Transfer-Encoding: 8bit

What happens if you leave off the href from your clicklink syntax and only use htmlid?  I've never tried using both together.
-- Lisa


-------------- Original message from Marco Neri <marcon@objectconsulting.com.au>: -------------- 


Hi. 
I have checked out webtest from HEAD and built it using compile.plain. builds ok. I then copy webtest.jar out of the build/plain dir into lib dir and I run installTest.xml and builds successful. so far so good
I run my test suite of testcases ( which is working ok using build 543 but has no javascript support ). 
I run my test suite against the latest checkout build and test fails on trying to execute: 
<clicklink stepid="click Join Up" 
href="NewUserProfileForm.aspx"/> 
the error msg is: 
Exception 
"htmliId" or "label" must be set! 
Stacktrace 
com.canoo.webtest.engine.StepExecutionException: "htmliId" or "label" must be set!, Step: ClickLink at C:\webtestcheckout\webtest\testcases\networker_create_new_account_no_input.xml:27:  with (href="NewUserProfileForm.aspx", stepId="click Join Up", stepType="clicklink")
        at com.canoo.webtest.steps.request.ClickLink.verifyParameters(ClickLink.java:230) 


if i try using : 
<clicklink stepid="click Join Up" 
                                href="NewUserProfileForm.aspx" 
                                htmlid="lnkSignUp"/> 
the error msg is: 
Unexpected exception caught: com.gargoylesoftware.htmlunit.ScriptException: identifier is a reserved word 
Stacktrace 
com.canoo.webtest.engine.StepExecutionException: Unexpected exception caught: com.gargoylesoftware.htmlunit.ScriptException: identifier is a reserved word, Step: ClickLink at C:\webtestcheckout\webtest\testcases\networker_create_new_account_no_input.xml:28:  with (href="NewUserProfileForm.aspx", htmlId="lnkSignUp", stepId="click Join Up", stepType="clicklink")
        at com.canoo.webtest.steps.Step.handleUnexpectedException(Step.java:399) 
the source snippet for the link is: 
<A id="lnkSignUp" href="NewUserProfileForm.aspx">Sign&nbsp;Up</A><BR> 
Had a quick look on net ( im not css/html expert ). should there be an extra tag htmlid="lnkSignUp" and I'm mistakenly trying to use id=?
in an example that lisa crispin posted she used only id:..... 
>We found that if we use the htmlid, we don't need the form tags. Here is an example of the id: 
><INPUT name="Employee Payroll Summary" id="Employee Payroll Summary" type="button" value="Review" >class="wideButton" onclick="javascript: location.href = '/plan/reviewCompensation.vm';">
>And this is my webtest clickbutton syntax: 
><clickbutton stepid="go to payroll summary"
>htmlid="Employee Payroll Summary"/> 
thanks 
Marco ( a.k.a test gumby ) 
--NextPart_Webmail_9m3u9jl4l_26226_1102983789_0
Content-Type: text/html
Content-Transfer-Encoding: 8bit

<html>
<!-- BEGIN WEBMAIL STATIONERY -->
<head></head>
<body>
<!-- WEBMAIL STATIONERY noneset -->
<DIV></DIV>
<DIV>What happens if you leave off the href from your clicklink syntax and only use htmlid?&nbsp; I've never tried using both together.</DIV>
<DIV>-- Lisa</DIV><BR>
<BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">-------------- Original message from Marco Neri &lt;marcon@objectconsulting.com.au&gt;: -------------- <BR><BR>
<META content="MS Exchange Server version 5.5.2653.12" name=Generator>
<P><FONT face="Times New Roman">Hi.</FONT> <BR><FONT face="Times New Roman">I have checked out webtest from HEAD and built it using compile.plain. builds ok. I then copy webtest.jar out of the build/plain dir into lib dir and I run installTest.xml and builds successful. so far so good</FONT></P>
<P><FONT face="Times New Roman">I run my test suite of testcases ( which is working ok using build 543 but has no javascript support ).</FONT> <BR><FONT face="Times New Roman">I run my test suite against the latest checkout build and test fails on trying to execute: </FONT><BR><FONT face="Times New Roman">&lt;clicklink stepid="click Join Up"</FONT> <BR><FONT face="Times New Roman">href="NewUserProfileForm.aspx"/&gt;</FONT> <BR><FONT face="Times New Roman">the error msg is:</FONT> <BR><B><FONT face="Times New Roman" size=4>Exception</FONT></B> <BR><FONT face="Times New Roman">"htmliId" or "label" must be set! </FONT><BR><B><FONT face="Times New Roman" size=4>Stacktrace</FONT></B> <BR><FONT face="Courier New" size=2>com.canoo.webtest.engine.StepExecutionException: "htmliId" or "label" must be set!, Step: ClickLink at C:\webtestcheckout\webtest\testcases\networker_create_new_account_no_input.xml:27:&nbsp; with (href="NewUserProfileForm.aspx", stepId="click Join Up", stepType="clicklink")</FONT></P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT face="Courier New" size=2>at com.canoo.webtest.steps.request.ClickLink.verifyParameters(ClickLink.java:230)</FONT> </P><BR>
<P><FONT face=Arial size=2>if i try using :</FONT> </P>
<P><FONT face=Arial size=2>&lt;clicklink stepid="click Join Up"</FONT> <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT face=Arial size=2>href="NewUserProfileForm.aspx"</FONT> <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT face=Arial size=2>htmlid="lnkSignUp"/&gt;</FONT> </P>
<P><FONT face=Arial size=2>the error msg is: </FONT></P>
<P><FONT face="Times New Roman">Unexpected exception caught: com.gargoylesoftware.htmlunit.ScriptException: identifier is a reserved word </FONT><BR><B><FONT face="Times New Roman" size=4>Stacktrace</FONT></B> <BR><FONT face="Courier New" size=2>com.canoo.webtest.engine.StepExecutionException: Unexpected exception caught: com.gargoylesoftware.htmlunit.ScriptException: identifier is a reserved word, Step: ClickLink at C:\webtestcheckout\webtest\testcases\networker_create_new_account_no_input.xml:28:&nbsp; with (href="NewUserProfileForm.aspx", htmlId="lnkSignUp", stepId="click Join Up", stepType="clicklink")</FONT></P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT face="Courier New" size=2>at com.canoo.webtest.steps.Step.handleUnexpectedException(Step.java:399)</FONT> </P>
<P><FONT face=Arial size=2>the source snippet for the link is:</FONT> </P>
<P><FONT face=Arial size=2>&lt;A id="lnkSignUp" href="NewUserProfileForm.aspx"&gt;Sign&amp;nbsp;Up&lt;/A&gt;&lt;BR&gt;</FONT> </P>
<P><FONT face=Arial size=2>Had a quick look on net ( im not css/html expert ). should there be an extra tag htmlid="lnkSignUp" and I'm mistakenly trying to use id=?</FONT></P>
<P><FONT face=Arial size=2>in an example that lisa crispin posted she used only id:.....</FONT> </P>
<P><FONT face="Times New Roman">&gt;We found that if we use the htmlid, we don't need the form tags. Here is an example of the id: </FONT><BR><FONT face="Times New Roman">&gt;&lt;INPUT name="Employee Payroll Summary" id="Employee Payroll Summary" type="button" value="Review" &gt;class="wideButton" onclick="javascript: location.href = '/plan/reviewCompensation.vm';"&gt;</FONT></P>
<P><FONT face="Times New Roman">&gt;And this is my webtest clickbutton syntax: </FONT><BR><FONT face="Times New Roman">&gt;&lt;clickbutton stepid="go to payroll summary"<BR>&gt;htmlid="Employee Payroll Summary"/&gt; </FONT></P>
<P><FONT face=Arial size=2>thanks</FONT> </P>
<P><FONT face=Arial size=2>Marco ( a.k.a test gumby )</FONT> </P></BLOCKQUOTE>
<!-- END WEBMAIL STATIONERY -->

</body>
</html>

--NextPart_Webmail_9m3u9jl4l_26226_1102983789_0--