How to loop tests in Selenium IDE?

Do this:

  1. Download this js file: https://github.com/darrenderidder/sideflow/blob/master/sideflow.js
  2. Launch Selenium IDE from Firefox and open the options menu.
  3. Upload the .js file to the "Selenium Core extensions (user-extensions.js)" field.

The js file provides goto, gotoIf and while loop functionality in Selenium IDE. The example below shows a simple 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>

as stated in the answer above, install the user extension, which will add loop functionality to Selenium IDE tests. The example below shows a simple 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>

No need to install/download anything, the built-in times command does this very easily:

  1. Insert a new line at the beginning of your script, select times as its Command and 10 (for instance) as its Target.
  2. Scroll down to the bottom of your script, and add a new line with end as its command
  3. Press the "Run" button as usual.
  4. Your commands are executed 10 times.

In this example I click on a button 2000 times:

enter image description here

To loop forever, just replace 10 with an extremely large number, that will take centuries to execute, which probably is as good as forever if you are running Selenium IDE.