[Webtest] how to test a form with input type="radio"
Piergiuliano Bossi
webtest@lists.canoo.com
Wed, 15 Jan 2003 10:20:09 +0100
--------------ECC1221765D2A8899B4ECC5F
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
All,
thanks a lot for the help, now the picture is clear. We have really
missed the javascript issue!
Just a brief report: we have spoken with the customer. The customer
likes current UI, so at the moment he doesn't want to change UI
behavior. We don't really like the idea to add hidden buttons or images
just for acceptance tests reasons. Therefore, right now the feature
remains untested (from an acceptance test point of view), also because
this behavior is already tested via other means.
We will allocate time in the future to explore the javascript issue,
eventually using HttpUnit directly, but the customer likes Canoo and he
would prefer to work directly driving ant. We may consider to extend
javascript support in Canoo. Is there any (un)official plan in the near
future for it?
Thanks again,
Giuliano
Piergiuliano Bossi wrote:
> Hello all,
>
> I have a form done this way:
>
> **********************CUT HERE**********************
> <FORM
> action="/xptracking/servlet/NodeDisplayer?display=ProjectHomeNode"
> id="userStoryFilterForm" method="POST">
> <TABLE border="0" cellpadding="4" cellspacing="0">
> <TR bgcolor="#A0A0A0">
> <TD width="10"></TD>
> <TD>All</TD>
> <TD><INPUT checked="checked" id="filterTypeAll"
> name="userStoryFilter" onclick="form.submit()" type="radio"
> value="all"></TD>
>
> <TD width="20"></TD>
> <TD>Not planned</TD>
> <TD><INPUT id="filterTypeNeverPlanned" name="userStoryFilter"
> onclick="form.submit()" type="radio" value="never planned"></TD>
>
> <TD width="20"></TD>
> <TD>Not completed</TD>
> <TD><INPUT id="filterTypeNotCompleted" name="userStoryFilter"
> onclick="form.submit()" type="radio" value="not completed"></TD>
>
> <TD width="20"></TD>
> <TD>Completed</TD>
> <TD><INPUT id="filterTypeCompleted" name="userStoryFilter"
> onclick="form.submit()" type="radio" value="completed"></TD><TD
> width="10"></TD>
> </TR>
> </TABLE>
> </FORM>
> **********************CUT HERE**********************
>
> As you can see I have a table with just one row and 4 groups of
> columns. Each group has some text, some separators and an INPUT of
> type="radio".
> The idea is that when I click on one of the radio inputs, it should
> submit the form, passing the value corresponding to the clicked input.
>
> While the above HTML works perfectly, I was not able to test it using
> WebTest. I tried the following:
>
> <setcheckbox
> stepid="Activate not planned"
> name="userStoryFilter"
> value="never planned" />
>
> but while it generates no error I don't see any action taken, that is
> I don't see the effect on the page that I get using the browser and
> really clicking on the input. All subsequent tests fail.
>
> I have seen on the syntax reference that clickbutton only supports
> input type="submit" or "image", but I don't understand if this the
> cause: instead of using setcheckbox I should really using clickbutton,
> provided that type="radio" is supported.
>
> What do you think? Am I following the wrong path? Do you see any
> alternative?
> Thanks a lot,
> Giuliano
>
--------------ECC1221765D2A8899B4ECC5F
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
All,
<p>thanks a lot for the help, now the picture is clear. We have really
missed the javascript issue!
<p>Just a brief report: we have spoken with the customer. The customer
likes current UI, so at the moment he doesn't want to change UI behavior.
We don't really like the idea to add hidden buttons or images just for
acceptance tests reasons. Therefore, right now the feature remains untested
(from an acceptance test point of view), also because this behavior is
already tested via other means.
<br>We will allocate time in the future to explore the javascript issue,
eventually using HttpUnit directly, but the customer likes Canoo and he
would prefer to work directly driving ant. We may consider to extend javascript
support in Canoo. Is there any (un)official plan in the near future for
it?
<p>Thanks again,
<br>Giuliano
<p>Piergiuliano Bossi wrote:
<blockquote TYPE=CITE>Hello all,
<p>I have a form done this way:
<p>**********************CUT HERE**********************
<br><tt><font color="#3333FF"><FORM action="/xptracking/servlet/NodeDisplayer?display=ProjectHomeNode"
id="userStoryFilterForm" method="POST"></font></tt>
<br><tt><font color="#3333FF"> <TABLE border="0" cellpadding="4"
cellspacing="0"></font></tt>
<br><tt><font color="#3333FF"> <TR bgcolor="#A0A0A0"></font></tt>
<br><tt><font color="#3333FF"> <TD width="10"></TD></font></tt>
<br><tt><font color="#3333FF"> <TD>All</TD></font></tt>
<br><tt><font color="#3333FF"> <TD><INPUT
checked="checked" id="filterTypeAll" name="userStoryFilter" onclick="form.submit()"
type="radio" value="all"></TD></font></tt>
<p><tt><font color="#3333FF"> <TD width="20"></TD></font></tt>
<br><tt><font color="#3333FF"> <TD>Not
planned</TD></font></tt>
<br><tt><font color="#3333FF"> <TD><INPUT
id="filterTypeNeverPlanned" name="userStoryFilter" onclick="form.submit()"
type="radio" value="never planned"></TD></font></tt>
<p><tt><font color="#3333FF"> <TD width="20"></TD></font></tt>
<br><tt><font color="#3333FF"> <TD>Not
completed</TD></font></tt>
<br><tt><font color="#3333FF"> <TD><INPUT
id="filterTypeNotCompleted" name="userStoryFilter" onclick="form.submit()"
type="radio" value="not completed"></TD></font></tt>
<p><tt><font color="#3333FF"> <TD width="20"></TD></font></tt>
<br><tt><font color="#3333FF"> <TD>Completed</TD></font></tt>
<br><tt><font color="#3333FF"> <TD><INPUT
id="filterTypeCompleted" name="userStoryFilter" onclick="form.submit()"
type="radio" value="completed"></TD><TD width="10"></TD></font></tt>
<br><tt><font color="#3333FF"> </TR></font></tt>
<br><tt><font color="#3333FF"> </TABLE></font></tt>
<br><tt><font color="#3333FF"></FORM></font></tt>
<br>**********************CUT HERE**********************
<p>As you can see I have a table with just one row and 4 groups of columns.
Each group has some text, some separators and an INPUT of type="radio".
<br>The idea is that when I click on one of the radio inputs, it should
submit the form, passing the value corresponding to the clicked input.
<p>While the above HTML works perfectly, I was not able to test it using
WebTest. I tried the following:
<p> <setcheckbox
<br> stepid="Activate not planned"
<br> name="userStoryFilter"
<br> value="never planned" />
<p>but while it generates no error I don't see any action taken, that is
I don't see the effect on the page that I get using the browser and really
clicking on the input. All subsequent tests fail.
<p>I have seen on the syntax reference that clickbutton only supports input
type="submit" or "image", but I don't understand if this the cause: instead
of using setcheckbox I should really using clickbutton, provided that type="radio"
is supported.
<p>What do you think? Am I following the wrong path? Do you see any alternative?
<br>Thanks a lot,
<br>Giuliano
<br> </blockquote>
</html>
--------------ECC1221765D2A8899B4ECC5F--