3 messages in com.canoo.lists.webtest[Webtest] VerifyRadioButton:
FromSent OnAttachments
Paul King13 Aug 2004 01:51 
Roman Moukhine [ram]16 Aug 2004 13:46 
Roman Moukhine [ram]16 Aug 2004 14:19 
Subject:[Webtest] VerifyRadioButton:
From:Roman Moukhine [ram] (rams@hotmail.com)
Date:08/16/2004 01:46:14 PM
List:com.canoo.lists.webtest

Hello everybody

I noticed that we are missing in core set a verification for radiobuttons. I
wrote such step as well as junit for it and WebTest selftestcase.

http://webtest-community.canoo.com/wiki/space/VerifyRadioButton (I took the format of the step description from Paul King to allow pages look
similar)

This step allows verifying the state of a single radio button as well as a whole
group. It is possible to verify whether any radio button in a group with
specified name is checked/unchecked or particular radio button (with the
specified value) in a group is checked/unchecked. syntax:

name - the HTML name, that radio button group shares.
<small>(optional)</small></li> on - if any readio button or radio button with the value (if specified, see attr
"value") hecked/uncheked.(optional, if value specified, then default "true") value - radio button with value should be checked/unchecked (see attr: "on")
(optional) formname - the name of the form if the are radio button groups with the same in
several forms (optional) stepid - the name of the step. (optional)

examples:

<target name="verifyradiobuttonstep" > <testSpec name="verifyradiobuttonstep"> &config; <steps> <invoke url="verifyradiobtn.html" /> <verifyradiobutton name='radioBtn'
value='value2' stepid='verify if the radio button with value2 checked' /> <verifyradiobutton name='radioBtn' on='false' value='value1' formname='radioform' stepid='verify that the radio button with value1 uncheked' /> <verifyradiobutton name='radioBtn' on='true' stepid='verify that one of the radio buttons in the group checked'/> </steps> </testSpec> </target>

The above example assumes that your HTML includes a form with radio buttons like
the one shown below:

<form name='radioform' action='/radio.do' method='GET'> <input name='radioBtn' type='radio' value='value1'/> <input name='radioBtn' type='radio' value='value2' checked='checked' /> </form>

best regards - ram