简体   繁体   English

如何在Robot Framework中创建自定义测试用例设置

[英]How to create custom testcase settings in Robot Framework

I want to create a custom settings (OR Attribute) (say TEST_ID ) in Robot Framework to tag them with test id. 我想在Robot Framework中创建自定义设置(或属性)(例如TEST_ID ),以使用测试ID标记它们。 During teardown I will use that settings to update my test management tool to record the execution result. 在拆卸期间,我将使用该设置来更新我的测试管理工具以记录执行结果。

*** Test Cases ***
Test With Settings
    [Documentation]    Another dummy test
    [Tags]    dummy    owner-johndoe
    [TEST_ID] XXX
    Log    Hello, world!

There is no need to create a new attribute. 无需创建新属性。 You can use tags. 您可以使用标签。 You could tag your tests with something like ALMID:5432. 您可以使用诸如ALMID:5432之类的标签标记测试。 In the teardown, the tags are available via the builtin variable @{TEST_TAGS}. 在拆解中,可通过内置变量@ {TEST_TAGS}使用标签。 The list could be searched and the id extracted from the tag. 可以搜索列表,并从标签中提取ID。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM