![](/img/trans.png)
[英]How to add internal links to Suite Metadata on Robot-Framework report.html?
[英]Robot framework - How to read suite name, test case name along with skip message from report.html
我正在使用“机器人框架”进行自动化测试,如果我在自动化脚本执行过程中遇到任何功能问题,我将创建一个缺陷并通过将缺陷编号作为跳过消息( Skip Defect#001
)。 在解决该缺陷之前,将跳过受影响的测试脚本。
例子:
*** Settings ***
Library SeleniumLibrary
Library BuiltIn
*** Test Cases ***
Custom auto scenarios1
Skip Defect_001
Log Test1
Custom auto scenarios2
Log Test2
Custom auto scenarios3
Log Test3
Custom auto scenarios4
Skip Defect_002
Log Test4
我有一个要求,我需要从report.html
中检索以下信息
Defect_001
和Defect_002
)Custom auto scenarios1
和Custom auto scenarios4
)Demo
) 你能告诉我如何从report.html
中检索这些吗
您需要使用机器人 API 并对output.xml
文件进行操作。
from robot.api import ExecutionResult, ResultVisitor
class Collector(ResultVisitor):
def visit_test(self, test):
if test.skipped:
print(test.name, test.message, test.parent.name)
es = ExecutionResult("output.xml")
collector = Collector()
es.visit(collector)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.