[Webtest] Canoo v1.6 build 544 (httpunit 1.6) Javascript Support?

Lisa Crispin webtest@lists.canoo.com
Mon, 13 Dec 2004 20:56:02 +0000


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

I don't know with which build number WebTest started to be based on HtmlUnit, but I would think you need the HtmlUnit-based WebTest to work with the Javascript.  

Also, I think you need to use the value, Htmlid or name attribute for clickbutton to find the button, I dunno about using that alt attribute.  (I am clearly not an expert at this).

We've gone ahead and added Htmlid to all our links and buttons, and it makes life much easier for WebTest scripts.
-- Lisa


-------------- Original message from rxhill@regence.com: -------------- 


Hi, I using Canoo v1.6 build 544 with httpunit 1.6, and I'm trying to use the 'clickbutton' test step to click a button that uses the 'onClick' javascript. I've been unable to use clickbutton to locate and submit the form. Can anyone point out what I'm doing wrong? Does Canoo need to be configured for javascript use? 

Thanks, 
Richard 

------------- 
Html Src: 
------------- 
<form method="post" action="" name="MemberUserAgreementForm"> 

  <input type="Hidden" name="USER_ACCEPTANCE_NAME_PARAMETER_KEY" value="MEMBER-MYCO"> 
  <input type="Hidden" name="USER_ACCEPTANCE_VERSION_PARAMETER_KEY" value="1"> 
  <input type="Hidden" name="USER_ACCEPTANCE_RELEASE_PARAMETER_KEY" value="1"> 

  <input type="image" src="../images/buttonAgree.gif" alt="I Agree" border="0"   
               onclick="form.action='https://ros-uat.myco.com/member/or/register.do?action=acceptAgreement'"> 

                &nbsp;&nbsp; 

  <input type="image" src="../images/buttonDisagree.gif" alt="I Disagree" border="0"                               
              onClick="form.action='register?jadeAction=USER_AGREEMENT_REJECTED_ACTION'"> 
</form> 

--------------- 
Test Step: 
--------------- 
<clickbutton stepid="Click 'Agree' button" 
                         label="I Agree"> 
      <form name="MemberUserAgreementForm" /> 
</clickbutton> 

----------------------- 
Error Message: 
----------------------- 

com.canoo.webtest.engine.StepFailedException: Button with name <<not specified>> 
and value <I Agree> not found!, Step: ClickButton at file:C:/Development/sandbox/canoo_1.6-544/tests/rosm/bvt/Register.xml:36: with (label="I Agree", step Id="Click &apos;Agree&apos; button", stepType="clickbutton") 
==============================================================================
IMPORTANT NOTICE: This communication, including any attachment, contains information that may be confidential or privileged, and is intended solely for the entity or individual to whom it is addressed. If you are not the intended recipient, you should delete this message and are hereby notified that any disclosure, copying, or distribution of this message is strictly prohibited. Nothing in this email, including any attachment, is intended to be a legally binding signature.
==============================================================================
--NextPart_Webmail_9m3u9jl4l_26501_1102971362_0
Content-Type: text/html
Content-Transfer-Encoding: 8bit

<html>
<!-- BEGIN WEBMAIL STATIONERY -->
<head></head>
<body>
<!-- WEBMAIL STATIONERY noneset -->
<DIV>I don't know with which build number WebTest started to be based on HtmlUnit, but I would think you need the HtmlUnit-based WebTest to work with the Javascript.&nbsp; </DIV>
<DIV>&nbsp;</DIV>
<DIV>Also, I think you need to use the value, Htmlid or name attribute for clickbutton to find the button, I dunno about using that alt attribute.&nbsp; (I am clearly not an expert at this).</DIV>
<DIV>&nbsp;</DIV>
<DIV>We've gone ahead and added Htmlid to all our links and buttons, and it makes life much easier for WebTest scripts.</DIV>
<DIV>-- Lisa</DIV><BR>
<BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">-------------- Original message from rxhill@regence.com: -------------- <BR><BR><BR><FONT face=sans-serif size=2>Hi, I using Canoo v1.6 build 544 with httpunit 1.6, and I'm trying to use the 'clickbutton' test step to click a button that uses the 'onClick' javascript. I've been unable to use clickbutton to locate and submit the form. Can anyone point out what I'm doing wrong? Does Canoo need to be configured for javascript use?</FONT> <BR><BR><FONT face=sans-serif size=2>Thanks,</FONT> <BR><FONT face=sans-serif size=2>Richard</FONT> <BR><BR><FONT face=sans-serif size=2>-------------</FONT> <BR><FONT face=sans-serif size=2>Html Src:</FONT> <BR><FONT face=sans-serif size=2>-------------</FONT> <BR><FONT face=sans-serif size=2>&lt;form method="post" action="" name="MemberUserAgreementForm"&gt;</FONT> <BR><BR><FONT face=sans-serif size=2>&nbsp; &lt;input type="Hidden" name="USER_ACCEPTANCE_NAME_PARAMETER_KEY" value="MEMBER-MYCO"&gt;</FONT> <BR><FONT face=sans-serif size=2>&nbsp; &lt;input type="Hidden" name="USER_ACCEPTANCE_VERSION_PARAMETER_KEY" value="1"&gt;</FONT> <BR><FONT face=sans-serif size=2>&nbsp; &lt;input type="Hidden" name="USER_ACCEPTANCE_RELEASE_PARAMETER_KEY" value="1"&gt;</FONT> <BR><BR><FONT face=sans-serif size=2>&nbsp; &lt;input type="image" src="../images/buttonAgree.gif" alt="I Agree" border="0" &nbsp;</FONT> <BR><FONT face=sans-serif size=2>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;onclick="form.action='https://ros-uat.myco.com/member/or/register.do?action=acceptAgreement'"&gt;</FONT> <BR><BR><FONT face=sans-serif size=2>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &amp;nbsp;&amp;nbsp;</FONT> <BR><BR><FONT face=sans-serif size=2>&nbsp; &lt;input type="image" src="../images/buttonDisagree.gif" alt="I Disagree" border="0" &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </FONT><BR><FONT face=sans-serif size=2>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; onClick="form.action='register?jadeAction=USER_AGREEMENT_REJECTED_ACTION'"&gt;</FONT> <BR><FONT face=sans-serif size=2>&lt;/form&gt;</FONT> <BR><BR><FONT face=sans-serif size=2>---------------</FONT> <BR><FONT face=sans-serif size=2>Test Step:</FONT> <BR><FONT face=sans-serif size=2>---------------</FONT> <BR><FONT face=sans-serif size=2>&lt;clickbutton stepid="Click 'Agree' button"</FONT> <BR><FONT face=sans-serif size=2>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;label="I Agree"&gt;</FONT> <BR><FONT face=sans-serif size=2>&nbsp; &nbsp; &nbsp; &lt;form name="MemberUserAgreementForm" /&gt;</FONT> <BR><FONT face=sans-serif size=2>&lt;/clickbutton&gt;</FONT> <BR><BR><FONT face=sans-serif size=2>-----------------------</FONT> <BR><FONT face=sans-serif size=2>Error Message:</FONT> <BR><FONT face=sans-serif size=2>-----------------------</FONT> <BR><BR><FONT face=sans-serif size=2>com.canoo.webtest.engine.StepFailedException: Button with name &lt;&lt;not specified&gt;&gt; </FONT><BR><FONT face=sans-serif size=2>and value &lt;I Agree&gt; not found!, Step: ClickButton at file:C:/Development/sandbox/canoo_1.6-544/tests/rosm/bvt/Register.xml:36: with (label="I Agree", step Id="Click &amp;apos;Agree&amp;apos; button", stepType="clickbutton") </FONT>
<P>==============================================================================<BR>IMPORTANT NOTICE: This communication, including any attachment, contains information that may be confidential or privileged, and is intended solely for the entity or individual to whom it is addressed. If you are not the intended recipient, you should delete this message and are hereby notified that any disclosure, copying, or distribution of this message is strictly prohibited. Nothing in this email, including any attachment, is intended to be a legally binding signature.<BR>==============================================================================<BR></P></BLOCKQUOTE>
<!-- END WEBMAIL STATIONERY -->

</body>
</html>

--NextPart_Webmail_9m3u9jl4l_26501_1102971362_0--