tags:

views:

149

answers:

2

Need to store check box value in a variable and if it is "on" i need to call a functions else i need to call different function.

A: 

You need to use the Flow Control extension/plugin and the storeChecked command.

See following example:

<tr>
  <td>storeChecked</td>
  <td>id=myCheckbox</td>
  <td>isChecked</td>
</tr>
<tr>
  <td>gotoIf</td>
  <td>${isChecked} == true</td>
  <td>isChecked</td>
</tr>
<tr>
  <td>echo</td>
  <td>Checkbox is NOT checked</td>
  <td></td>
</tr>
<tr>
  <td>goto</td>
  <td>done</td>
  <td></td>
</tr>
<tr>
  <td>label</td>
  <td>isChecked</td>
  <td></td>
</tr>
<tr>
  <td>echo</td>
  <td>Checkbox is checked</td>
  <td></td>
</tr>
<tr>
  <td>label</td>
  <td>done</td>
  <td></td>
</tr>
<tr>
  <td>echo</td>
  <td>Done!</td>
  <td></td>
</tr>
Dave Hunt
A: 

The following blog post details how you can skip rows after a failed test (e.g. is check box checked) and then resume at a later point. You could have two of these, one for checked, the other for unchecked.

The example given is:

|Skip Subsequent Rows If A Step Fails|  
|Do Something|Funny|  
|Check|Is|Everyone|Laughing|true|  
|Do Something|Hilarious|  
|Check|Is|Everyone|Laughing|true|  
|Do Something|Mean|  
|Check|Is|Everyone|Laughing|true|  
|This row would be skipped|  
|So would this one|  
|Resume|  
|This row will be executed now|  
|And so on...|  

Controlling test flow in FitNesse (making it stop running rows)

http://theroamingcoder.com/node/3

Bigwave