Search code examples
testingselenium-ide

How to loop tests in Selenium IDE?


I've been testing in Selenium IDE. It's pretty easy to use, and I have created some test cases with it. I've been searching Google, trying to find a way to repeat my tests automatically. I've seen a solution with gotolabel, while loops, etc. But I couldn't make any of them works. Can someone give me a tip on how to loop my test n times, or loop forever. I appreciate any help.


Solution

  • 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>