0

Is for loop present in Selenium IDE? if yes, How can I use it in Selenium IDE?

Thanks, Nit

Ripon Al Wasim
  • 36,924
  • 42
  • 155
  • 176
Nits
  • 19
  • 1
  • 1
  • 5

2 Answers2

2

We can use while loop and goto function in Selenium IDE.

For that we must install the addon flow control. Add from the following link:

Selenium IDE: Flow Control

After installing you will get the commands while and gotoif in Selenium IDE

1) Example for while loop

<tr>
    <td>getEval</td>
    <td>index = 0;</td>
    <td></td>
</tr>
<tr>
    <td>while</td>
    <td>index &lt; 10;</td>
    <td></td>
</tr>
<tr>
    <td>storeEval</td>
    <td>index</td>
    <td>value</td>
</tr>
<tr>
    <td>echo</td>
    <td>${value}</td>
    <td></td>
</tr>
<tr>
    <td>getEval</td>
    <td>index++;</td>
    <td></td>
</tr>
<tr>
    <td>endWhile</td>
    <td></td>
    <td></td>
</tr>

2) Example for gotoif

store  |  10  |  x

gotoIf | storedVars['x'] > -2 && storedVars['x'] <50  |  true

getEval| alert("Condition Fails")

gotolabel | finish

label  |  true

getEval  | alert("Condition Pass")

label  | finish


try this Thank you..
Ripon Al Wasim
  • 36,924
  • 42
  • 155
  • 176
Nikhil Surendran
  • 956
  • 4
  • 14
  • 25
0

Yes, we can have looping in IDE
You can refer below URL for looping in IDE

Selenium IDE: How to Pass Variables
How to write gotoif (i > -2 && i < 100) in Selenium IDE?
http://radical-qa.blogspot.in/2012/02/selenium-ide_09.html

Community
  • 1
  • 1
Rohit Ware
  • 1,982
  • 1
  • 13
  • 29