我知道如果满足特定条件我们如何使用run关键字但我想在testcasename匹配时运行关键字。
@encode
有谁知道我们怎样才能做到这一点。
答案 0 :(得分:1)
Robot框架提供了几个automatic variables - 由框架自动设置的变量。一个这样的变量是${TEST_NAME}
。
在以下示例中,仅运行第二个测试中的日志语句:
*** Test Cases ***
Example 1
run keyword if "${TEST_NAME}" == "Example 2"
... log this is example 2?
Example 2
run keyword if '${TEST_NAME}' == "Example 2"
... log this is example 2!
答案 1 :(得分:0)
Run Keyword If '${TEST_NAME}'=='<your_test_name>' <Keyword> <args>