[Webtest] Fix for Radio Buttons

Aatish Arora webtest@lists.canoo.com
Tue, 20 May 2003 03:24:54 -0700 (PDT)


--0-745373093-1053426294=:66148
Content-Type: text/plain; charset=us-ascii
Content-Id: 
Content-Disposition: inline

Hi all,

Heres another one: A fix for Radio Buttons. (Courtesy
- Jitendra Chavan). The syntax and
the src files are attached. If anyone does need the
Jar file - do mail me personally.

Cheers!
Aatish Arora


=====
================================================
Six monkeys pounding on six typewriters at random for a million years will recreate all the works of Isaac Asimov.
================================================

__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com
--0-745373093-1053426294=:66148
Content-Type: application/x-zip-compressed; name="RadioButton.zip"
Content-Transfer-Encoding: base64
Content-Description: RadioButton.zip
Content-Disposition: attachment; filename="RadioButton.zip"

UEsDBBQAAAAIAKddtC6OFKUFGwUAAJsPAAATAAAAU2V0UmFkaW9CdXR0b24u
amF2YaVXUW/bOAx+bn6FlofB7gb3gHvMCqxrAyyHdivW7nD3NCg2k+jqSD5J
bpMN/e9HSpYt22nXwwQUcEWKpMiPn5iK53d8DSxX2yznUqnsAZYWjM2MhcrM
JhOxrZS2BxRAroWE7FxJCzs7+6niDRqc7yCvrVByvsuhoo/Owz/8nmcoLLOP
3GyueDUbSy6FsQe2z7Tmey8LQqXX2cPveVZgOJ9UAb2TQ+FhAd9CQdI4FFLY
bcvM8F12c/ZXfI2T4+MJO2bveW03SrM/hAVZaM7ON7zecImyk0lVL0uRs7zk
xrAbsF94IdSH2lolGSYRD+A25on9mEwYrkqLe26BLZUqgUu2WpjzDeR3UMx6
8hurhVyzVWSPwmenTNZleVj3T17WnYZX8eHdK1EwA9ZpJI3+Pf2TYmCsWa0B
J5l1+22MKLM6iB4Pumg0k3BBEc72PMUWRT8Dh83S5UPgup+TnuFxvgbaPSeu
wrSOqXbshGlAX8xugFVcW5HXJdfeAlv6oi73DAQqaMaLgqLhTMIDqaNxCzrY
s8qZkQiC6yAzrETQIuSC1LkbiLNgY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lXfs5702JQ6Lmxw7KNr96fyVjLaFU5BcyXsNraLWM7+pV
tRdb+/P+iDoIJnfhOf7LyJ58Hf0HUEsBAhQAFAAAAAgAp120Lo4UpQUbBQAA
mw8AABMAAAAAAAAAAQAgALaBAAAAAFNldFJhZGlvQnV0dG9uLmphdmFQSwEC
FAAUAAAACACuXbQuCJll7tUFAAAIEwAAFgAAAAAAAAABACAAtoFMBQAAVmVy
aWZ5UmFkaW9CdXR0b24uamF2YVBLBQYAAAAAAgACAIUAAABVCwAAAAA=

--0-745373093-1053426294=:66148
Content-Type: text/plain; name="syntax.html.diff"
Content-Description: syntax.html.diff
Content-Disposition: inline; filename="syntax.html.diff"

@@ -2118,26 +2118,100 @@
 	&lt;/<font color="blue">testSpec</font>&gt;<br>
 &lt;/<font color="blue">target</font>&gt;<br>
 
-		
+<br>
+<b>verifyradiobutton</b>
+<br>
+
+
+<br>The <i>&lt;verifyradiobutton&gt;</i> test step is used to verify the state of a radio button (selected/unselected).
+        A particular radio button can be specified via name and value.<br>
+
+
+<br>
+
+<table width="100%" cellspacing="0" cellpadding="2" border="1">
+<tr>
+<th width="12%">Attribute</th><th width="78%">Description</th><th width="10%">Required</th>
+</tr>
+<tr>
+<td valign="top">stepid</td><td valign="top">The name of this test step.</td><td valign="top" align="center">No</td>
+</tr>
+<tr>
+<td valign="top">name</td><td valign="top">The name of the radio button</td><td valign="top" align="center">Yes</td>
+</tr>
+<tr>
+<td valign="top">checked</td><td valign="top">Specifies if the radio button shall be checked (true) or unchecked (false).</td><td valign="top" align="center">Yes</td>
+</tr>
+<tr>
+<td valign="top">value</td><td valign="top">That is the value associated with the radio button. Can be used to fully
+                    qualify a particular radio button.</td><td valign="top" align="center">No</td>
+</tr>
+</table>
+
+<br>
+
+
+<br>Here is a simple example for verifying that a particular radio button is not selected. The radio button is uniquely
+        identified by its name.<br>
+
+
+<br>
+<table cellpadding="5" width="0" bgcolor="#FFFFC0" border="0">
+<tbody>
+<tr>
+<td align="right"><b>verifyradiobutton 1</b></td>
+</tr>
+<tr>
+<td>
+<div class="code">
+			&lt;<font color="blue">testSpec</font>&nbsp;<font color="darkgreen">name</font>="<font color="brown">Check&nbsp;all&nbsp;links&nbsp;on&nbsp;current&nbsp;page,&nbsp;on&nbsp;subpages&nbsp;and&nbsp;on&nbsp;their&nbsp;subpages</font>"&gt;<br>
+
+		&nbsp;&nbsp;
+	&lt;<font color="blue">config</font>&nbsp;...&nbsp;/&gt;<br>
+
+		&nbsp;&nbsp;
+	&lt;<font color="blue">steps</font>&gt;<br>
+
+		&nbsp;&nbsp;
+
+		&nbsp;&nbsp;
+	&lt;<font color="blue">invoke</font>&nbsp;...&nbsp;/&gt;<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;<font color="blue">verifyradiobutton</font>
+<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="darkgreen">stepid</font>="<font color="brown">Verify&nbsp;that&nbsp;option&nbsp;is&nbsp;not&nbsp;selected</font>"<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="darkgreen">name</font>="<font color="brown">anchovis</font>"<br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="darkgreen">checked</font>="<font color="brown">false</font>"/&gt;<br>
+
+		&nbsp;&nbsp;
+	&lt;/<font color="blue">steps</font>&gt;<br>
+&lt;/<font color="blue">testSpec</font>&gt;<br>
+
+
 </div>
 </td>
 </tr>
 </tbody>
 </table>
 
 
@@ -2318,7 +2392,125 @@
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="darkgreen">label</font>="<font color="brown">Login</font>"&nbsp;/&gt;<br>
 
 		&nbsp;&nbsp;
-	
+
+		&nbsp;&nbsp;
+	...<br>
+
+		&nbsp;&nbsp;
+	&lt;/<font color="blue">steps</font>&gt;<br>
+&lt;/<font color="blue">testSpec</font>&gt;<br>
+
+
+</div>
+</td>
+</tr>
+</tbody>
+</table>
+
+<br>
+<b>setradiobutton</b>
+<br>
+
+
+<br> The <i>&lt;setradiobutton&gt;</i> test step is used to check and uncheck radio buttons. When checking
+        a particular radio button a value associated with the parameter in the subsequent request can be provided.
+        A default is used if it is ommited.<br>
+
+
+<br>
+
+<table width="100%" cellspacing="0" cellpadding="2" border="1">
+<tr>
+<th width="12%">Attribute</th><th width="78%">Description</th><th width="10%">Required</th>
+</tr>
+<tr>
+<td valign="top">stepid</td><td valign="top">The name of this test step.</td><td valign="top" align="center">No</td>
+</tr>
+<tr>
+<td valign="top">name</td><td valign="top">That is the name of the radio button and also the parameter to be submitted</td><td valign="top" align="center">Yes</td>
+</tr>
+<tr>
+<td valign="top">checked</td><td valign="top">Specifies if the radio button shall be checked (true) or unchecked (false).
+                    Is implicitely set to true if value is specified.</td><td valign="top" align="center">Yes</td>
+</tr>
+<tr>
+<td valign="top">value</td><td valign="top">That is the value to be submitted. A default ("on") is used if ommited.</td><td valign="top" align="center">No</td>
+</tr>
+</table>
+
+<br>
+
+
+<br>See the following example for plain vanilla radio button selection. The resulting request submitted by
+        &lt;clickbutton&gt; will contain a parameter with the radio button name and as value the default radio button
+        parameter value <i>"on"</i>.<br>
+
+
+<br>
+<table cellpadding="5" width="0" bgcolor="#FFFFC0" border="0">
+<tbody>
+<tr>
+<td align="right"><b>setradiobutton 1</b></td>
+</tr>
+<tr>
+<td>
+<div class="code">
+			&lt;<font color="blue">testSpec</font>&nbsp;<font color="darkgreen">name</font>="<font color="brown">Choose&nbsp;all&nbsp;desired&nbsp;pizza&nbsp;toppings&nbsp;by&nbsp;checking&nbsp;them</font>"&gt;<br>
+
+		&nbsp;&nbsp;
+	&lt;<font color="blue">config</font>&nbsp;...&nbsp;/&gt;<br>
+
+		&nbsp;&nbsp;
+	&lt;<font color="blue">steps</font>&gt;<br>
+
+		&nbsp;&nbsp;
+
+		&nbsp;&nbsp;
+	&lt;<font color="blue">invoke</font>&nbsp;...&nbsp;/&gt;<br>
+
+		&nbsp;&nbsp;
+
+		&nbsp;&nbsp;
+
+		&nbsp;&nbsp;
+	&lt;<font color="blue">setradiobutton</font>&nbsp;<font color="darkgreen">stepid</font>="<font color="brown">Select&nbsp;the&nbsp;cheese&nbsp;option</font>"<br>
+
+		&nbsp;&nbsp;
+
+		&nbsp;&nbsp;
+
+		&nbsp;&nbsp;
+
+		&nbsp;&nbsp;
+	<font color="darkgreen">name</font>="<font color="brown">Cheese</font>"<br>
+
+		&nbsp;&nbsp;
+
+		&nbsp;&nbsp;
+
+		&nbsp;&nbsp;
+
+		&nbsp;&nbsp;
+	<font color="darkgreen">checked</font>="<font color="brown">true</font>"&nbsp;/&gt;<br>
+
+		&nbsp;&nbsp;
+
+		&nbsp;&nbsp;
+
+		&nbsp;&nbsp;
+	&lt;<font color="blue">clickbutton</font>&nbsp;<font color="darkgreen">stepid</font>="<font color="brown">Submit&nbsp;the&nbsp;selected&nbsp;options</font>"<br>
+
+		&nbsp;&nbsp;
+
+		&nbsp;&nbsp;
+
+		&nbsp;&nbsp;
+
+		&nbsp;&nbsp;
+	<font color="darkgreen">label</font>="<font color="brown">Choose</font>"&nbsp;/&gt;<br>
+
+		&nbsp;&nbsp;
+
 		&nbsp;&nbsp;
 	...<br>

--0-745373093-1053426294=:66148--