How to loop tests in Selenium IDE?

后端 未结 8 1933
生来不讨喜
生来不讨喜 2020-12-13 23:31

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 test

8条回答
  •  情深已故
    2020-12-14 00:14

    I'm new to Selenium (just started using it a few minutes ago). After a quick Google search for "selenium loop" this stackoverflow.com question came up. I immediately jumped into the extension and started using loops. The accepted answer is very helpful. However, I wanted to point out something else for others that are new to selenium (and stumble on this page).

    I created a simple test for a simple web page. I added a loop so that the test would run indefinitely (until I paused/stopped it). However, I noticed that by doing this, the Runs/Failures counters within the Selenium GUI do not increment with each loop (I am guessing because a single test case was never running to completion, it was just looping indefinitely). So I dug a bit further. My goal was to leave the same test running for a long time (a few hours, or possibly overnight) to see if there were any failures (I'm chasing an intermittent bug at the moment).

    The simplest way (for me, after a few minutes of searching/experimenting) was to do the following (likely no plugins needed, although the attached plugin is definitely helpful if you want to run a few small loops within a test case):

    • save the test case to a text file
    • save the test suite to a text file
    • open the test suite text file in a text editor
    • copy and paste the test case multiple times within the test suite (for example, a thousand times)
    • then open the test suite in Selenium, and run the test suite

    Now I have the same simple test suite running many times, and the Runs/Failures counters are incrementing as expected (without the need for any loops).

提交回复
热议问题