我们通过google找到解决方案但未能成功,我们如何将已记录的脚本添加到新脚本中。Selenium IDE:将测试脚本包含到新测试脚本中
3
A
回答
3
Selenium-Core有一个扩展:“include”,它可以将另一个测试的内容添加到当前测试中。 以下是OpenQA wiki上的页面:http://wiki.openqa.org/display/SEL/include,但不幸的是目前无法访问。 我曾经在过去使用它,但最终放弃了ROLLUP RULES。
但是,如果您正在寻找一种在多个测试用例中重用脚本的方法,我强烈建议您使用汇总规则。这是Selenium IDE的许多用户功能非常强大和低估的。
使用汇总规则的详细信息写在Selenium IDE的帮助页面上:菜单帮助 - UI元素文档,然后按关键字“汇总”进行搜索。
0
我最终使用了Yevgen建议的Rollups。我花了一些时间来找到实现这一点的正确方法。基本思想是编写一个JavaScript文件,并将其添加到Selenium IDE的Selenium Core Extensions设置下的options/options下。您需要编写的JavaScript文件才能构建“可重用的命令堆栈”,这将允许您使用内置汇总命令,并将目标设置为您分配给一组命令的标签。
我写了一篇关于Selenium IDE Includes AKA Rollups的文章,可能是一个有用的资源。
一个例子汇总脚本:
/**
* For use in Selenium IDE.
*
* You will need to add this to Selenium under Options/Options in the Selenium Menu.
* Put this under Selenium Core Extensions:
* ~/selenium-ide-for-slp/sideflow.js , ~/selenium-ide-for-slp/slp_rollups.js
*
*
*/
var manager = new RollupManager();
/**
* check_for_syntax_errors
*
* This rollup tests for php syntax errors, warnings, and notices.
*/
manager.addRollupRule({
name: 'check_for_syntax_errors',
description: 'Check for PHP syntax errors, notices, warnings.',
args: [],
commandMatchers: [],
getExpandedCommands: function(args) {
var commands = [];
commands.push({
command: 'assertNotText',
target: '//body',
value: '*Notice: Undefined*'
});
commands.push({
command: 'assertNotText',
target: '//body',
value: '**Notice: Trying to get*'
});
commands.push({
command: 'assertNotText',
target: '//body',
value: '*Notice: Use of*'
});
commands.push({
command: 'assertNotText',
target: '//body',
value: '*Fatal error:*'
});
return commands;
}
});
希望有所帮助。
相关问题
- 1. 试图运行Selenium IDE Python脚本作为测试套件
- 2. 如何编写包含多个测试用例的Python Selenium测试脚本?
- 3. 用于Python的IDE:测试脚本
- 4. from selenium测试脚本返回selenese
- 5. 测试ruby脚本
- 6. 测试Python脚本
- 7. Shell脚本测试
- 8. 测试脚本描述框
- 9. Selenium IDE:在测试中执行测试
- 10. 如何从另一个测试脚本调用测试脚本?
- 11. 硒Android的测试脚本
- 12. PHP(版本5.5到5.6),测试脚本
- 13. MSBuild脚本中的硒测试
- 14. 在线测试脚本
- 15. 如何测试猪脚本
- 16. 测试bash shell脚本
- 17. 自动测试shell脚本
- 18. Gatling负载测试脚本
- 19. 什么是测试脚本?
- 20. 贡献R测试脚本
- 21. RSpec的测试Ruby脚本
- 22. 测试幻像JS脚本
- 23. Shell脚本测试命令
- 24. J-Meter - Moodle测试脚本
- 25. 如何从watir webdriver中的另一个测试脚本调用测试脚本
- 26. 测试贝哈特脚本在Googlechrome
- 27. 从Selenium Java测试脚本连接到MySQL数据库失败
- 28. Selenium - Java在测试脚本中等待页面加载失败
- 29. 如何测试sql脚本是junit测试中的标准sql?
- 30. squish GUI测试中的测试脚本指南
谢谢,我会尽力的。 – Faiyaz