Selenium IDE:在测试中执行测试
我使用 selenium IDE(带有流程控制扩展)编写了一个测试,该测试迭代 2 个下拉列表中的元素(使用 2 个循环),并根据下拉列表中选择的元素填充数据输入表单。
本质上,每次迭代的形式都是不同的,而不是使用流程控制在一次测试中处理这个问题(使测试变得非常大)。是否可以在循环内执行的另一个测试中覆盖此功能?
这可以在 Selenium IDE 中完成吗?
如果可以的话,您能指出任何在线示例/教程吗?
感谢您抽出宝贵的时间,
大卫
I have written a test using selenium IDE (with flow control extensions) that iterates through elements within 2 drop-down lists (using 2 loops) and populates a data entry form according to the elements selected in the drop-down lists.
Esstially the form is different for each iteration, rather than using flow control to handle this in one test (making the test extremely large). Would it possible to cover this functionallty in another test executed from within the loop?
Can this be done in Selenium IDE?
If it can be done, can you point toward any online examples/tutorials?
Thank you for your time
David
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Selenium IDE 是一个非常简单的工具。您想封装您的测试以便在其他测试中重用吗?您想使用循环和流量控制吗?
听起来您已经准备好学习真正的编程语言了。
将您的测试导出为 java 或 ruby 或任何您喜欢的语言。然后你就可以使用编程语言的流程控制和面向对象来解决你的问题。这比尝试弄清楚如何使其在 IDE 中工作要容易得多。另外,您的测试将更易于维护。
http://seleniumhq.org/docs/05_selenium_rc.html#from -selenese-to-a-program
http://seleniumhq .org/docs/06_test_design_considerations.html#page-object-design-pattern
The Selenium IDE is a pretty simple tool. You want to encapsulate of your test for reuse in other tests? And you want to use loops and flow control?
It sounds like you're ready to graduate to a real programming language.
Export your tests to java or ruby or whatever language you like. Then you can use the flow control and object orientation of the programming language to solve your problems. That will be easier than trying to figure out how to make it work in the IDE. Plus your tests will be more maintainable.
http://seleniumhq.org/docs/05_selenium_rc.html#from-selenese-to-a-program
http://seleniumhq.org/docs/06_test_design_considerations.html#page-object-design-pattern
以下是一个向 Selenium IDE 添加成熟循环、条件执行和可调用函数的扩展:SelBlocks
您在测试中设置了 script/endScript 部分,然后使用参数调用它。例如:(
字符串值被引用,因为参数是常规的 JavaScript 表达式。)
Here is an extension that adds full-fledged looping, conditional execution, and callable functions to Selenium IDE: SelBlocks
You setup a script/endScript section in your test, and then call it with parameters. For example:
(String values are quoted because parameters are regular javascript expressions.)