在Selenium IDE中进行脚本重复回放测试------录好的脚本怎么重复播放

原文:http://blog.chinaunix.net/uid-8481040-id-2996277.html

介绍:http://iytc.net/wordpress/?p=2082

Selenium IDE的脚本语言比较简单,没有过程控制结构,所以没有办法做重复测试。

为了在IDE中增加过程控制功能,在Firefox里面可以安装一个叫做Flow control的控件
(  https://addons.mozilla.org/en-US/firefox/addon/flow-control/)。
 
安装之后,可以在IDE中使用while ... endWhile结构。
例子:
  1. store 1000 total
  2. store 0 count
  3. while storedVars['count'] < storedVars['total']
  4. getEval storedVars['count'] += 1
  5. ....
  6. ....
  7. ....
  8. endWhile
在例子中,循环体里面的语句将会执行1000次。
注意While 里面的判断是javascript格式,通过storedVars数组可以访问到selenium里面的存储变量。

猜你喜欢

转载自www.cnblogs.com/wenjun145/p/12894165.html
今日推荐