开发者

storeValue in Selenium IDE

Need to store check box value in a variable and if it is "on" i need to call a function else开发者_Python百科 call a different function.


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>


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜