【发布时间】:2020-06-23 23:27:24
【问题描述】:
我遇到了 for 循环的问题。
收到错误“FOR 循环不包含关键字”。
我有一个要导入的 yaml 文件。
test_sequence_1:
- test_name: "Test"
test_items:
- test_name1
- test_name2
然后我将其导入并尝试对其进行迭代。
*** Settings ***
Library BuiltIn
Library Collections
Variables ../vars/vrf_test_cases.yaml
*** Test Cases ***
Run Sequential Tests
Launch test cases sequence @{test_sequence_1}
然后运行关键字,我尝试了不同的 for 循环和各种其他选项。我一辈子都无法让第二个 For 循环工作
Launch test cases sequence
#TODO add a default empty value for extra_vars_dict
[Documentation] Launch a given set of workflow templates from a yaml dictionary
[Arguments] @{test_sequence_dict}
FOR ${sequence} IN @{test_sequence_dict}
Log to Console \n\n\n Launching: ${sequence['test_name']}
@{test_list}= Convert To List ${sequence['test_items']}
Log to Console \n Run Tests var: @{test_list}[0]
#FOR ${test} IN @{sequence['test_items']}
#Log to Console ${test}
#Run Keyword ${test}
#END
FOR ${test} IN @{test_list}
Log to Console ${test}
END
END
我觉得我错过了什么,想知道缺少的部分是什么。
【问题讨论】:
标签: yaml robotframework