0

我尝试了以下方法,但不幸的是它不起作用。

<tr>
    <td>gotoIf</td>
    <td>${lnn}&gt;-2 &amp;&amp; ${lnn}&lt;100</td>
    <td>label111</td>
</tr>
4

3 回答 3

2
store  |  10  |  i
gotoIf | storedVars['i'] > -2 && storedVars['i'] <100  |  true
getEval| alert("Condition Fails")
gotolabel | finish
label  |  true
getEval  | alert("Condition Pass")
label  | finish

您可以为 i 传递任何值。

于 2012-07-10T14:05:41.983 回答
0

使用以下代码并让我知道您是否仍然收到相同的错误消息?

- Created one JScript file ith following content.

var searchValue=new Array("-1","-2","500","300","20","100","12");


store | 0 | looptimes
while | storedVars.looptimes <= 6   
storeEval | searchValue[storedVars.looptimes] | search
open | http://www.google.co.in/     
waitForText | id=gbqfba | Google Search
waitForText | id=hplogo | India
gotoIf | storedVars['search'] > -2 && storedVars['search'] <100 | labelforthis
getEval | alert("Value is not greater than -2 and less than 100.")  
label | labelforthis
type | id=gbqfq | ${search}
click | id=gbqfb    
store | javascript{storedVars.looptimes++;}     
endWhile    
于 2012-07-10T13:38:33.150 回答
0
gotoIf | storedVars['search'] > -2 && storedVars['search'] <100 | labelforthis

可以替换为

gotoIf | -2 < storedVars['search'] <100 | labelforthis
于 2013-10-29T10:36:58.103 回答