[Webtest] how to test a form with input type="radio"

Daniel Sheppard webtest@lists.canoo.com
Wed, 15 Jan 2003 10:30:56 +1100


Aside from the javascript issue, you're also breaking expected UI contrac=
t by making radio buttons action objects rather than options.

The expected behaviour when clicking a radio button is that it selects an=
=20option in preperation for a submit, but that no actual action is taken=
. Action should occur on clicking a submit button.

A better page design would be one that had a <input type=3D"submit"> next=
=20to each option.

If you're really desperate to have little circles to click on instead, us=
e
<input type=3D"image" alt=3D"submit" src=3D"radio_circle.jpg">

This will give you your pretty circle without needing javascript and also=
=20catering for non-graphical browsers.


-----Original Message-----
From: Piergiuliano Bossi [mailto:P.Bossi@quinary.com]
Sent: Wednesday, 15 January 2003 4:55 AM
To: webtest@gate.canoo.com
Subject: [Webtest] how to test a form with input type=3D"radio"


Hello all,=20
I have a form done this way:=20
**********************CUT HERE**********************=20
<FORM action=3D"/xptracking/servlet/NodeDisplayer?display=3DProjectHomeNo=
de" id=3D"userStoryFilterForm" method=3D"POST">=20
=20 <TABLE border=3D"0" cellpadding=3D"4" cellspacing=3D"0">=20
=20   <TR bgcolor=3D"#A0A0A0">=20
=20     <TD width=3D"10"></TD>=20
=20     <TD>All</TD>=20
=20     <TD><INPUT checked=3D"checked" id=3D"filterTypeAll" name=3D"userS=
toryFilter" onclick=3D"form.submit()" type=3D"radio" value=3D"all"></TD> =

=20=20
=20     <TD width=3D"20"></TD>=20
=20     <TD>Not planned</TD>=20
=20     <TD><INPUT id=3D"filterTypeNeverPlanned" name=3D"userStoryFilter"=
=20onclick=3D"form.submit()" type=3D"radio" value=3D"never planned"></TD>=
=20
=20=20
=20     <TD width=3D"20"></TD>=20
=20     <TD>Not completed</TD>=20
=20     <TD><INPUT id=3D"filterTypeNotCompleted" name=3D"userStoryFilter"=
=20onclick=3D"form.submit()" type=3D"radio" value=3D"not completed"></TD>=
=20
=20=20
=20     <TD width=3D"20"></TD>=20
=20     <TD>Completed</TD>=20
=20     <TD><INPUT id=3D"filterTypeCompleted" name=3D"userStoryFilter" on=
click=3D"form.submit()" type=3D"radio" value=3D"completed"></TD><TD width=
=3D"10"></TD>=20
=20   </TR>=20
=20 </TABLE>=20
</FORM>=20
**********************CUT HERE**********************=20
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=3D"radio".=
=20
The idea is that when I click on one of the radio inputs, it should submi=
t the form, passing the value corresponding to the clicked input.=20
While the above HTML works perfectly, I was not able to test it using Web=
Test. I tried the following:=20
=20   <setcheckbox=20
=20    stepid=3D"Activate not planned"=20
=20    name=3D"userStoryFilter"=20
=20    value=3D"never planned" />=20
but while it generates no error I don't see any action taken, that is I d=
on't see the effect on the page that I get using the browser and really c=
licking on the input. All subsequent tests fail.=20
I have seen on the syntax reference that clickbutton only supports input =
type=3D"submit" or "image", but I don't understand if this the cause: ins=
tead of using setcheckbox I should really using clickbutton, provided tha=
t type=3D"radio" is supported.=20
What do you think? Am I following the wrong path? Do you see any alternat=
ive?=20
Thanks a lot,=20
Giuliano=20
=20=20
#########################################################################=
############
This email has been scanned by MailMarshal, an email content filter.
#########################################################################=
############