Как написать gotoif (i › -2 && i ‹ 100) в Selenium IDE?

Я попробовал следующий метод, но, к сожалению, он не сработал.

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

person Suyog Sakegaonkar    schedule 10.07.2012    source источник


Ответы (3)


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.

person Rohit Ware    schedule 10.07.2012

Используйте следующий код и дайте мне знать, если вы все еще получаете то же сообщение об ошибке?

- 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    
person Prashant Vadher    schedule 10.07.2012

gotoIf | storedVars['search'] > -2 && storedVars['search'] <100 | labelforthis

можно заменить на

gotoIf | -2 < storedVars['search'] <100 | labelforthis
person Radu    schedule 29.10.2013