How to run Selenium tests repeatedly in infinite loop

We have a series of tests and we need to run them repeatedly for an extended length of time but there is no settings in Selenium IDE that allows infinite loop test run. In this article, will show the workaround to achieve that.

  • Open Selenium IDE and create a new project.

  • Add new test named "infinite loop run".

  • Enter the following commands:

    1. Command:
      execute script
      Target:
      return 0;
      Value:
      index

    2. Command:
      while
      Target:
      1
      Value:

    3. Command:
      execute script
      Target:

      window.seleniumTests = ['test 1', 'test 2', 'test 3'];
      return window.seleniumTests[${index}];
            
      Value:
      test
    4. Command:
      execute script
      Target:

      var count = ${index};
      count++;
      if (count >= window.seleniumTests.length) {
        count = 0;
      }
      return count;
            
      Value:
      index
    5. Command:
      run
      Target:
      ${test}
      Value:

    6. Command:
      end
      Target:

      Value:

    This is our Selenium IDE tests should look like:

    Selenium IDE infinite loop tests run workaround setup

  • Add the tests that needs to run repeatedly for an extended length of time named "test 1", "test 2" and "test And supply the commands that you need to execute for "test 1", "test 2" and "test 3" tests.

  • To run the "test 1", "test 2" and "test 3" tests infinitely, click the test named "infinite loop run" and click "Run current test" play button.

Comments

Your article is too good and informative. I am searching for Selenium and I get exact article i am thankful to you for sharing this educational article . and the way you written is also good, you covered up all the points which i searching for & I am impressed by reading this article. Keep writing and sharing educational article like this which can help us to grow our knowledge.

Really helpful and easy approach really good job

Add new comment

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.