Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
690 views
in Technique[技术] by (71.8m points)

testing - 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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...