robotframework - 在机器人框架中迭代测试用例
问题描述
我有一个测试用例,我必须迭代测试用例的次数。有什么方法可以迭代测试用例吗?
Signin-Personal-Account
[Tags] Tvh2
Given Number of users signs in to their respective devices ${xyz}
Then xyz sees that Sign in is successful
When xyz signs out from the device
Then xyz sees that sign out was successful
And Signin is repeated for 5 times for Ellie```
测试必须重复5次。如何使测试用例迭代次数?
解决方案
这可以使用 for 循环来实现:
*** Test cases ***
Multiple sign in test
:FOR ${index} IN RANGE 5
\ Signin-Personal-Account
*** Keywords ***
Signin-Personal-Account
[Tags] Tvh2
Given Number of users signs in to their respective devices ${xyz}
Then xyz sees that Sign in is successful
When xyz signs out from the device
Then xyz sees that sign out was successful
FOR
确保根据您使用的机器人框架版本检查循环语法 - FOR 循环语法
推荐阅读
- kotlin - 如何缓存 gradle 插件依赖项?
- javascript - 如何正则表达式匹配并返回具有已知起始格式并以双换行符结尾的字符串?
- javascript - 如何将此滚动动画隔离为容器代替?
- c - 在 C 中重新安装设置信号
- r - 如何编写一个R循环来添加多个excel文件,更改它们的列名,然后基于一行组合它们?
- javascript - 如何在不清除字段值的情况下更改表单字段的属性?
- python - ConnectionResetError: [WinError 10054] 现有连接被远程主机错误强行关闭
- c# - IF 奇数/偶数条件检查的行为相反
- python - NameError:名称'self'未定义:Python
- python - 远程计算机上的 Visual Studio 调试