robotframework - 使用“登录到控制台”通过控制台显示标签
问题描述
我正在尝试获取定义的test.robot
文件内容[Tags]
并将其显示在控制台上。这是我所拥有的:
[Tags] cat dog
现在,我想知道如何Log To Console
输出标签?
到目前为止,我已经尝试了以下方法:
${TagVariable}= Tags
${TagVariable1}= Tags[0]
${TagVariable2}= Tags[1]
${TagVariable3}= [Tags]
${TagVariable4}= [Tags][0]
${TagVariable5}= [Tags][1]
Log To Console Tags
Log To Console [Tags]
Log To Console [Tags][0]
Log To Console [Tags][1]
Log To Console ${TagVariable}
Log To Console ${TagVariable1}
Log To Console ${TagVariable2}
Log To Console ${TagVariable3}
Log To Console ${TagVariable4}
Log To Console ${TagVariable5}
我似乎无法理解它。
解决方案
Robot 提供了几个自动变量。你可以在这里找到所有这些
你需要的就是这个
@{TEST TAGS}
:按字母顺序包含当前测试用例的标签。可以使用 Set Tags 和 Remove Tags 关键字动态修改。
根据您的上下文,您可能需要\n@{TEST TAGS}
在文件中将其打印为 , 。.robot
推荐阅读
- jenkins - 将证书作为代码添加到 Jenkins 配置
- c# - 客户端验证在 asp.net .net 框架 4.5.2 中不起作用
- javascript - Thymeleaf / JavaScript 保持动态填充选择元素的值
- .net - 在 SharpDevelop 中选择 .Net Compiler 4.x
- c++ - 将 *.a 编译为 *.so
- azure - 如何在 azure databricks 数据库中一次获取所有表列
- firebase - cron-job.org Firebase 可调用函数
- scala - 如何捕获从 Future[HttpResponse] scala 抛出的异常
- unit-testing - 在颤振中测试 kIsWeb 常量
- javascript - 当复选框在行项目级别(不是批处理行项目级别,只是主要的)更改时,所有批处理行项目也会更改