[Webtest] Canoo v1.6 build 544 (httpunit 1.6) Javascript Support?
Lisa Crispin
webtest@lists.canoo.com
Mon, 13 Dec 2004 23:04:29 +0000
--NextPart_Webmail_9m3u9jl4l_15821_1102979069_0
Content-Type: text/plain
Content-Transfer-Encoding: 8bit
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"/>
It looked like you were using this 'alt' value for the clickbutton and I am not familiar with that, I've only used name, label and htmlid.
-- Lisa
-------------- Original message from rxhill@regence.com: --------------
Hi Lisa,
I upgraded my Canoo version and build to version 1.7, build 583 using htmlunit and it still is unable to find the button.
I looked on the webtest-communit site and found this:
http://webtest-community.canoo.com/wiki/space/Javascript
"identification methods other than by 'htmlid' (i.e. 'name','label') need a <form> tag around it. See mailinglist."
It references an email on the list, which is authored by you, but it doen't look like it applies to my situation.
I have the <form> tags around the button (see example further down this email correspondence), but it still doesn't work.
I'm not familiar with the "htmlid". Is this an attribute that is embedded in the html? Do you have an example of its use?
Thanks,
lisa.crispin@att.net
Sent by: webtest-admin@lists.canoo.com
12/13/2004 12:56 PM
Please respond to webtest
To: webtest@lists.canoo.com
cc:
Subject: Re: [Webtest] Canoo v1.6 build 544 (httpunit 1.6) Javascript Support?
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'">
<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 'Agree' 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.
==============================================================================
==============================================================================
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_15821_1102979069_0
Content-Type: text/html
Content-Transfer-Encoding: 8bit
<html>
<!-- BEGIN WEBMAIL STATIONERY -->
<head></head>
<body>
<!-- WEBMAIL STATIONERY noneset -->
<DIV></DIV>
<DIV>We found that if we use the htmlid, we don't need the form tags. Here is an example of the id:</DIV>
<DIV> <INPUT name="Employee Payroll Summary" id="Employee Payroll Summary" type="button" value="Review" class="wideButton" onclick="javascript: location.href = '/plan/reviewCompensation.vm';"><BR></DIV>
<DIV>And this is my webtest clickbutton syntax:</DIV>
<DIV> <clickbutton stepid="go to payroll summary"<BR> htmlid="Employee Payroll Summary"/> </DIV>
<DIV> </DIV>
<DIV>It looked like you were using this 'alt' value for the clickbutton and I am not familiar with that, I've only used name, label and htmlid.</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 Lisa,</FONT> <BR><FONT face=sans-serif size=2>I upgraded my Canoo version and build to version 1.7, build 583 using htmlunit and it still is unable to find the button. </FONT><BR><BR><FONT face=sans-serif size=2>I looked on the webtest-communit site and found this:</FONT> <BR><BR><FONT face=sans-serif size=2> http://webtest-community.canoo.com/wiki/space/Javascript</FONT> <BR><FONT face=sans-serif size=2> "identification methods other than by 'htmlid' (i.e. 'name','label') need a <form> tag around it. See mailinglist."</FONT> <BR><BR><FONT face=sans-serif size=2>It references an email on the list, which is authored by you, but it doen't look like it applies to my situation.</FONT> <BR><BR><FONT face=sans-serif size=2>I have the <form> tags around the button (see example further down this email correspondence), but it still doesn't work. </FONT><BR><BR><FONT face=sans-serif size=2>I'm not familiar with the "htmlid". Is this an attribute that is embedded in the html? Do you have an example of its use?</FONT> <BR><BR><FONT face=sans-serif size=2>Thanks,</FONT> <BR><BR><BR><BR>
<TABLE width="100%">
<TBODY>
<TR vAlign=top>
<TD>
<TD><FONT face=sans-serif size=1><B>lisa.crispin@att.net</B></FONT> <BR><FONT face=sans-serif size=1>Sent by: webtest-admin@lists.canoo.com</FONT>
<P><FONT face=sans-serif size=1>12/13/2004 12:56 PM</FONT> <BR><FONT face=sans-serif size=1>Please respond to webtest</FONT> <BR><BR></P>
<TD><FONT face=Arial size=1> </FONT><BR><FONT face=sans-serif size=1> To: webtest@lists.canoo.com</FONT> <BR><FONT face=sans-serif size=1> cc: </FONT> <BR><FONT face=sans-serif size=1> Subject: Re: [Webtest] Canoo v1.6 build 544 (httpunit 1.6) Javascript Support?</FONT></TR></TBODY></TABLE><BR><BR><BR><FONT face="Times New Roman" size=3>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. </FONT> <BR><FONT face="Times New Roman" size=3> </FONT> <BR><FONT face="Times New Roman" size=3>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).</FONT> <BR><FONT face="Times New Roman" size=3> </FONT> <BR><FONT face="Times New Roman" size=3>We've gone ahead and added Htmlid to all our links and buttons, and it makes life much easier for WebTest scripts.</FONT> <BR><FONT face="Times New Roman" size=3>-- Lisa</FONT> <BR><BR><FONT face="Times New Roman" size=3>-------------- Original message from rxhill@regence.com: -------------- <BR><BR></FONT><FONT face=sans-serif size=2><BR>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><FONT face="Times New Roman" size=3> <BR></FONT><FONT face=sans-serif size=2><BR>Thanks,</FONT><FONT face="Times New Roman" size=3> </FONT><FONT face=sans-serif size=2><BR>Richard</FONT><FONT face="Times New Roman" size=3> <BR></FONT><FONT face=sans-serif size=2><BR>-------------</FONT><FONT face="Times New Roman" size=3> </FONT><FONT face=sans-serif size=2><BR>Html Src:</FONT><FONT face="Times New Roman" size=3> </FONT><FONT face=sans-serif size=2><BR>-------------</FONT><FONT face="Times New Roman" size=3> </FONT><FONT face=sans-serif size=2><BR><form method="post" action="" name="MemberUserAgreementForm"></FONT><FONT face="Times New Roman" size=3> <BR></FONT><FONT face=sans-serif size=2><BR> <input type="Hidden" name="USER_ACCEPTANCE_NAME_PARAMETER_KEY" value="MEMBER-MYCO"></FONT><FONT face="Times New Roman" size=3> </FONT><FONT face=sans-serif size=2><BR> <input type="Hidden" name="USER_ACCEPTANCE_VERSION_PARAMETER_KEY" value="1"></FONT><FONT face="Times New Roman" size=3> </FONT><FONT face=sans-serif size=2><BR> <input type="Hidden" name="USER_ACCEPTANCE_RELEASE_PARAMETER_KEY" value="1"></FONT><FONT face="Times New Roman" size=3> <BR></FONT><FONT face=sans-serif size=2><BR> <input type="image" src="../images/buttonAgree.gif" alt="I Agree" border="0" </FONT><FONT face="Times New Roman" size=3> </FONT><FONT face=sans-serif size=2><BR> onclick="form.action='https://ros-uat.myco.com/member/or/register.do?action=acceptAgreement'"></FONT><FONT face="Times New Roman" size=3> <BR></FONT><FONT face=sans-serif size=2><BR> &nbsp;&nbsp;</FONT><FONT face="Times New Roman" size=3> <BR></FONT><FONT face=sans-serif size=2><BR> <input type="image" src="../images/buttonDisagree.gif" alt="I Disagree" border="0" <BR> onClick="form.action='register?jadeAction=USER_AGREEMENT_REJECTED_ACTION'"></FONT><FONT face="Times New Roman" size=3> </FONT><FONT face=sans-serif size=2><BR></form></FONT><FONT face="Times New Roman" size=3> </FONT><BR><FONT face=sans-serif size=2><BR>---------------</FONT><FONT face="Times New Roman" size=3> </FONT><FONT face=sans-serif size=2><BR>Test Step:</FONT><FONT face="Times New Roman" size=3> </FONT><FONT face=sans-serif size=2><BR>---------------</FONT><FONT face="Times New Roman" size=3> </FONT><FONT face=sans-serif size=2><BR><clickbutton stepid="Click 'Agree' button"</FONT><FONT face="Times New Roman" size=3> </FONT><FONT face=sans-serif size=2><BR> label="I Agree"></FONT><FONT face="Times New Roman" size=3> </FONT><FONT face=sans-serif size=2><BR> <form name="MemberUserAgreementForm" /></FONT><FONT face="Times New Roman" size=3> </FONT><FONT face=sans-serif size=2><BR></clickbutton></FONT><FONT face="Times New Roman" size=3> <BR></FONT><FONT face=sans-serif size=2><BR>-----------------------</FONT><FONT face="Times New Roman" size=3> </FONT><FONT face=sans-serif size=2><BR>Error Message:</FONT><FONT face="Times New Roman" size=3> </FONT><FONT face=sans-serif size=2><BR>-----------------------</FONT><FONT face="Times New Roman" size=3> <BR></FONT><FONT face=sans-serif size=2><BR>com.canoo.webtest.engine.StepFailedException: Button with name <<not specified>> <BR>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") </FONT>
<P><FONT face="Times New Roman" size=3>==============================================================================<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>==============================================================================</FONT>
<P>
<P>
<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_15821_1102979069_0--