[Webtest] struts with canoo webTest

webtest@lists.canoo.com webtest@lists.canoo.com
Mon, 27 Jan 2003 13:33:40 -0500


This is a multipart message in MIME format.
--=_alternative 0065F59085256CBB_=
Content-Type: text/plain; charset="us-ascii"

Thanks for the quick response.  I am real new to the webtest framework and 
was a little stumped.  I actually saw the "label"parameter after I posted. 
 I am currently using both the name and the label parameter in tandem. 

Thanks again,

Matt Zylstra








Chris Hane <chris@itsolut.com>
Sent by: webtest-admin@gate.canoo.com
01/27/2003 01:27 PM
Please respond to webtest

 
        To:     webtest@gate.canoo.com
        cc: 
        Subject:        Re: [Webtest] struts with canoo webTest



Matt,

In the <clickbutton> use "action" for the name attribute.  If you want to 
use "Login" to identify the button use the label attribute in 
<clickbutton>.  Your element should look like:

<clickbutton 
      name="action"     [or label="Login" ]
      stepid="Click the Login button"> 
      <form name="userInfo" /> 
</clickbutton> 

Chris....

At 1/27/2003 11:03 AM, you wrote:


Hi, 
I am using webtest to perform functional testing with our webapp.  We have 
been developing using the Struts framework.  My first problem deals with 
using forms. 
The html produced looks as follows: 
<form name="userInfo" method="POST" action="/webapp/ams/Login.do"> 
    <table border="0"> 
        <tr><td>User:</td><td><input type="text" name="userName" 
maxlength="15" size="15" value=""></td></tr> 
        <tr><td>Password:</td><td><input type="password" name="password" 
maxlength="15" size="15" value=""></td></tr> 
        <tr><td /><td><input type="submit" name="action" value="Login"> 

and the corresponding clickbutton statement is as follows: 
                        <setinputfield 
                                        stepid="set user name" 
                                        name="userName" 
                                        value="yyyyyyyy" /> 
                                <setinputfield 
                                        stepid="set password" 
                                        name="password" 
                                        value="xxxxxx" /> 
                          <clickbutton 
                                   name="Login" 
                                   stepid="Click the Login button"> 
                                        <form name="userInfo" /> 
                                </clickbutton> 

The error message I get back is: 
<failure message="com.canoo.webtest.engine.StepFailedException: Button with name <Login> and 
value <<not specified>> not found!, Step: ClickButton(id="Click the Login 
button"label=null)" /> 

I fully believe that the name attribute in the input block of the html is 
causing me the trouble.  I am a little confused what to do since Struts 
set that parameter with the property tag.  

If anyone has any suggestions, I am all ears. 

Thanks,

Matt Zylstra


--=_alternative 0065F59085256CBB_=
Content-Type: text/html; charset="us-ascii"


<br><font size=2 face="sans-serif">Thanks for the quick response. &nbsp;I am real new to the webtest framework and was a little stumped. &nbsp;I actually saw the &quot;label&quot;parameter after I posted. &nbsp;I am currently using both the name and the label parameter in tandem. &nbsp;</font>
<br>
<br><font size=2 face="sans-serif">Thanks again,<br>
<br>
Matt Zylstra<br>
<br>
<br>
<br>
</font>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td>
<td><font size=1 face="sans-serif"><b>Chris Hane &lt;chris@itsolut.com&gt;</b></font>
<br><font size=1 face="sans-serif">Sent by: webtest-admin@gate.canoo.com</font>
<p><font size=1 face="sans-serif">01/27/2003 01:27 PM</font>
<br><font size=1 face="sans-serif">Please respond to webtest</font>
<br>
<td><font size=1 face="Arial">&nbsp; &nbsp; &nbsp; &nbsp; </font>
<br><font size=1 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; To: &nbsp; &nbsp; &nbsp; &nbsp;webtest@gate.canoo.com</font>
<br><font size=1 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; cc: &nbsp; &nbsp; &nbsp; &nbsp;</font>
<br><font size=1 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; Subject: &nbsp; &nbsp; &nbsp; &nbsp;Re: [Webtest] struts with canoo webTest</font></table>
<br>
<br>
<br><font size=3 face="Times New Roman"><br>
Matt,<br>
<br>
In the &lt;clickbutton&gt; use &quot;action&quot; for the name attribute. &nbsp;If you want to use &quot;Login&quot; to identify the button use the label attribute in &lt;clickbutton&gt;. &nbsp;Your element should look like:<br>
</font><font size=2 face="Times New Roman"><br>
&lt;clickbutton <br>
 &nbsp; &nbsp; &nbsp;name=&quot;action&quot;</font><font size=3 face="Times New Roman"> &nbsp; &nbsp; [or label=&quot;Login&quot; ]</font><font size=2 face="Times New Roman"><br>
 &nbsp; &nbsp; &nbsp;stepid=&quot;Click the Login button&quot;&gt;</font><font size=3 face="Times New Roman"> </font><font size=2 face="Times New Roman"><br>
 &nbsp; &nbsp; &nbsp;&lt;form name=&quot;userInfo&quot; /&gt;</font><font size=3 face="Times New Roman"> </font><font size=2 face="Times New Roman"><br>
&lt;/clickbutton&gt;</font><font size=3 face="Times New Roman"> <br>
<br>
Chris....<br>
<br>
At 1/27/2003 11:03 AM, you wrote:<br>
<br>
</font>
<br><font size=2 face="Times New Roman">Hi, <br>
I am using webtest to perform functional testing with our webapp. &nbsp;We have been developing using the Struts framework. &nbsp;My first problem deals with using forms. &nbsp;<br>
The html produced looks as follows:</font><font size=3 face="Times New Roman"> </font><font size=2 face="Times New Roman"><br>
&lt;form name=&quot;userInfo&quot; method=&quot;POST&quot; action=&quot;/webapp/ams/Login.do&quot;&gt;</font><font size=3 face="Times New Roman"> </font><font size=2 face="Times New Roman"><br>
 &nbsp; &nbsp;&lt;table border=&quot;0&quot;&gt;</font><font size=3 face="Times New Roman"> </font><font size=2 face="Times New Roman"><br>
 &nbsp; &nbsp; &nbsp; &nbsp;&lt;tr&gt;&lt;td&gt;User:&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;userName&quot; maxlength=&quot;15&quot; size=&quot;15&quot; value=&quot;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;</font><font size=3 face="Times New Roman"> </font><font size=2 face="Times New Roman"><br>
 &nbsp; &nbsp; &nbsp; &nbsp;&lt;tr&gt;&lt;td&gt;Password:&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;password&quot; name=&quot;password&quot; maxlength=&quot;15&quot; size=&quot;15&quot; value=&quot;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;</font><font size=3 face="Times New Roman"> </font><font size=2 face="Times New Roman"><br>
 &nbsp; &nbsp; &nbsp; &nbsp;&lt;tr&gt;&lt;td /&gt;&lt;td&gt;&lt;input type=&quot;submit&quot; <b>name=&quot;action&quot;</b> value=&quot;Login&quot;&gt;</font><font size=3 face="Times New Roman"> <br>
</font><font size=2 face="Times New Roman"><br>
and the corresponding clickbutton statement is as follows:</font><font size=3 face="Times New Roman"> </font><font size=2 face="Times New Roman"><br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;setinputfield</font><font size=3 face="Times New Roman"> </font><font size=2 face="Times New Roman"><br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;stepid=&quot;set user name&quot; <br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;name=&quot;userName&quot; <br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;value=&quot;yyyyyyyy&quot; /&gt;</font><font size=3 face="Times New Roman"> </font><font size=2 face="Times New Roman"><br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;setinputfield</font><font size=3 face="Times New Roman"> </font><font size=2 face="Times New Roman"><br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;stepid=&quot;set password&quot;</font><font size=3 face="Times New Roman"> </font><font size=2 face="Times New Roman"><br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;name=&quot;password&quot;</font><font size=3 face="Times New Roman"> </font><font size=2 face="Times New Roman"><br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;value=&quot;xxxxxx&quot; /&gt;</font><font size=3 face="Times New Roman"> </font><font size=2 face="Times New Roman"><br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;clickbutton <br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; name=&quot;Login&quot;</font><font size=3 face="Times New Roman"> </font><font size=2 face="Times New Roman"><br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; stepid=&quot;Click the Login button&quot;&gt;</font><font size=3 face="Times New Roman"> </font><font size=2 face="Times New Roman"><br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;form name=&quot;userInfo&quot; /&gt;</font><font size=3 face="Times New Roman"> </font><font size=2 face="Times New Roman"><br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/clickbutton&gt;</font><font size=3 face="Times New Roman"> <br>
</font><font size=2 face="Times New Roman"><br>
The error message I get back is:</font><font size=3 face="Times New Roman"> </font><font size=3 color=blue face="Times New Roman"><br>
&lt;</font><font size=3 color=#990000 face="Times New Roman">failure</font><font size=3 face="Times New Roman"> </font><font size=3 color=#990000 face="Times New Roman">message</font><font size=3 color=blue face="Times New Roman">=&quot;</font><font size=3 face="Times New Roman"><b>com.canoo.webtest.engine.StepFailedException: Button with name &lt;Login&gt; and value &lt;&lt;not specified&gt;&gt; not found!, Step: ClickButton(id=&quot;Click the Login button&quot;label=null)</b></font><font size=3 color=blue face="Times New Roman">&quot; /&gt;</font><font size=3 face="Times New Roman"> <br>
</font><font size=2 face="Times New Roman"><br>
I fully believe that the name attribute in the input block of the html is causing me the trouble. &nbsp;I am a little confused what to do since Struts set that parameter with the property tag. &nbsp;</font><font size=3 face="Times New Roman"><br>
</font><font size=2 face="Times New Roman"><br>
If anyone has any suggestions, I am all ears.</font><font size=3 face="Times New Roman"> <br>
</font><font size=2 face="Times New Roman"><br>
Thanks,<br>
<br>
Matt Zylstra</font>
<br>
<br>
--=_alternative 0065F59085256CBB_=--