[Webtest] struts with canoo webTest

webtest@lists.canoo.com webtest@lists.canoo.com
Mon, 27 Jan 2003 12:03:42 -0500


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

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 005DB8ED85256CBB_=
Content-Type: text/html; charset="us-ascii"


<br><font size=2 face="sans-serif">Hi, </font>
<br><font size=2 face="sans-serif">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;</font>
<br><font size=2 face="sans-serif">The html produced looks as follows:</font>
<br><font size=2 face="sans-serif">&lt;form name=&quot;userInfo&quot; method=&quot;POST&quot; action=&quot;/webapp/ams/Login.do&quot;&gt;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &lt;table border=&quot;0&quot;&gt;</font>
<br><font size=2 face="sans-serif">&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>
<br><font size=2 face="sans-serif">&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>
<br><font size=2 face="sans-serif">&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>
<br>
<br><font size=2 face="sans-serif">and the corresponding clickbutton statement is as follows:</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;setinputfield</font>
<br><font size=2 face="sans-serif">&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; </font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; name=&quot;userName&quot; </font>
<br><font size=2 face="sans-serif">&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>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;setinputfield</font>
<br><font size=2 face="sans-serif">&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>
<br><font size=2 face="sans-serif">&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>
<br><font size=2 face="sans-serif">&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>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;clickbutton </font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;name=&quot;Login&quot;</font>
<br><font size=2 face="sans-serif">&nbsp; &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>
<br><font size=2 face="sans-serif">&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>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/clickbutton&gt;</font>
<br>
<br><font size=2 face="sans-serif">The error message I get back is:</font>
<br><font size=3 color=blue face="Times New Roman">&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"> </font>
<br>
<br><font size=2 face="sans-serif">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>
<br>
<br><font size=2 face="sans-serif">If anyone has any suggestions, I am all ears.</font>
<br>
<br><font size=2 face="sans-serif">Thanks,<br>
<br>
Matt Zylstra<br>
<br>
</font>
--=_alternative 005DB8ED85256CBB_=--