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:
-
Command:
execute script
Target:
return 0;
Value:
index -
Command:
while
Target:
1
Value: -
Command:
execute script
Target:window.seleniumTests = ['test 1', 'test 2', 'test 3']; return window.seleniumTests[${index}];
Value:
test -
Command:
execute script
Target:var count = ${index}; count++; if (count >= window.seleniumTests.length) { count = 0; } return count;
Value:
index -
Command:
run
Target:
${test}
Value: -
Command:
end
Target:
Value:
This is our Selenium IDE tests should look like:
-
-
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.
Thank You
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.