2014-11-04 81 views
0

嗨我想在Selenium中做一個簡單的遞減,但它不會返回減法,而不是返回一個字符串。按照我的代碼:Selenium IDE遞減值var

<tr> 
    <td>store</td> 
    <td>2</td> 
    <td>contador</td> 
</tr> 

<tr> 
    <td>store</td> 
    <td>${contador}--</td> 
    <td>contador</td> 
</tr> 

<tr> 
    <td>echo</td> 
    <td>${contador}</td> 
    <td></td> 
</tr> 

預期:1

但得到:2--

回答

0

我找到了!有人舉了一個例子「how to increment field value each time selenium test is run?

<tr> 
    <td>store</td> 
    <td>2</td> 
    <td>contador</td> 
</tr> 

<tr> 
    <td>storeEval</td> 
    <td>storedVars['contador'] = ${contador}-1</td> 
    <td>contador</td> 
</tr> 

<tr> 
    <td>echo</td> 
    <td>${contador}</td> 
    <td></td> 
</tr> 

現在結果是1!