【发布时间】:2016-05-15 00:29:08
【问题描述】:
如何使用模板化机器人关键字而不是使用[Template] 语法的整个测试用例?
需要的是:
资源文件在keywords.robot中创建一个关键字:
*** Keywords ***
Do Something
[Arguments] ${arg1} ${arg2}
Print args ${arg1} ${arg2}
机器人测试用例文件导入此资源并使用上述关键字:
Resource keywords.robot
*** Test cases ***
Some test case
Execute test step 1
Execute test step 2
Execute test step 3
#Now use the Keyword defined in resource file with [Template]
Do Something
[Template]
1 2
3 4
有没有办法达到上述要求?因为有些测试步骤需要用参数重复,而不是整个测试用例。 谢谢。
【问题讨论】:
-
你能进一步解释你想要做什么吗?这对我来说没有多大意义。如果测试步骤需要使用参数重复,为什么不创建一个关键字来做你想做的事情并传递你需要的任何东西?
标签: testing frameworks keyword robotframework parameterized