2010-05-18 47 views
0

需要將複選框值存儲在一個變量中,如果它是「開」,我需要調用一個函數否則調用一個不同的函數。Selenium IDE中的storeValue

+0

我與gotoif原型試過,但它是支承爲「 storetextpresent「而不是」存儲值「 – 2010-05-18 12:39:12

回答

2

您需要使用流量控制擴展/插件和storeChecked命令。

見下面的例子:

<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> 
0

以下博客文章的細節,你可以跳過如何測試失敗後的行(例如是複選框選中),然後繼續在稍後的點。你可以有兩個,一個用於檢查,另一個用於未選中。

給出的例子是:

|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...| 

控制在FitNesse的測試流程(使其停止運行行)

http://theroamingcoder.com/node/3