如何在 Selenium IDE 中循环测试? [英] How to loop tests in Selenium IDE?
问题描述
我一直在 Selenium IDE 中进行测试.它非常易于使用,我已经用它创建了一些测试用例.我一直在搜索谷歌,试图找到一种方法来自动重复我的测试.我已经看到了一个带有 gotolabel、while 循环等的解决方案.但我无法让它们中的任何一个工作.有人可以给我一个关于如何循环我的测试 n
次或永远循环的提示.我很感激任何帮助.
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.
推荐答案
这样做:
- 下载这个js文件:https://github.com/darrenderidder/sideflow/blob/master/sideflow.js
- 从 Firefox 启动 Selenium IDE 并打开选项菜单.
- 将 .js 文件上传到Selenium Core extensions (user-extensions.js)"字段.
js 文件在 Selenium IDE 中提供 goto、gotoIf 和 while 循环功能.下面的例子显示了一个简单的循环:
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 < 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>
这篇关于如何在 Selenium IDE 中循环测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!