How to write gotoif (i > -2 && i < 100) in Selenium IDE?

帅比萌擦擦* 提交于 2019-12-13 07:38:36

问题


I tried the following method, but unfortunately it did not work.

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

回答1:


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

You can pass any value for i.




回答2:


Use Following code and let me know if still you are getting same error message ?

- 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    



回答3:


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

can be replaced by

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


来源:https://stackoverflow.com/questions/11413653/how-to-write-gotoif-i-2-i-100-in-selenium-ide

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!