[英]Allure not able to read output.xml file generated by AllureReportLibrary in Robot Framework
I am using Ride (RobotFramework IDE) and I have imported Library AllureReportLibrary
in my project.我正在使用 Ride(RobotFramework IDE),并且在我的项目中导入了 Library
AllureReportLibrary
。 Using the Set Output Dir
, I am creating a Directory C:/AutomationLogs/Allure
and all the allure properties and xml files are getting generated in that path.使用
Set Output Dir
,我正在创建一个目录C:/AutomationLogs/Allure
并且所有的诱惑属性和 xml 文件都在该路径中生成。
Set Output Dir C:/AutomationLogs/
Then I am using the "allure serve C:\\AutomationLogs\\Allure" command to try and generate the html report file in command prompt, but it shows the below error -然后我使用“allure serve C:\\AutomationLogs\\Allure”命令尝试在命令提示符下生成html报告文件,但它显示以下错误 -
"Could not read result C:\\AutomationLogs\\Allure\\f56f4796-d30a-47f3-a988-d17f6c4e13ca-testsuite.xml: {} com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize va lue of type
ru.yandex.qatools.allure.model.SeverityLevel
from String "None": value not one of declared Enum instance names: [trivial, blocker, minor, normal, critical]"“无法读取结果 C:\\AutomationLogs\\Allure\\f56f4796-d30a-47f3-a988-d17f6c4e13ca-testsuite.xml: {} com.fasterxml.jackson.databind.exc.InvalidFormatException: 无法反序列化类型为
ru.yandex.qatools.allure.model.SeverityLevel
来自字符串“None”:值不是声明的 Enum 实例名称之一:[trivial、blocker、minor、normal、critical]”
The xml file " f56f4796-d30a-47f3-a988-d17f6c4e13ca-testsuite.xml
" was generated using the AllureReportLibrary xml 文件“
f56f4796-d30a-47f3-a988-d17f6c4e13ca-testsuite.xml
”是使用 AllureReportLibrary 生成的
Also the index.html file which is generated after the command opens after this command and shows Allure Report unknown unknown - unknown (Unknown) 0 test cases NaN%还有 index.html 文件,它在此命令后打开命令后生成,并显示 Allure Report unknown unknown - unknown (Unknown) 0 test cases NaN%
I am using the below - Allure version - 2.4.1我正在使用以下 - Allure 版本 - 2.4.1
Ride version - RIDE 1.5.2.1 running on Python 2.7.12. Ride 版本 - 在 Python 2.7.12 上运行的 RIDE 1.5.2.1。
I am new to Robot Framework and Allure.我是 Robot Framework 和 Allure 的新手。 Please let me know whether I have implemented it correctly and why I am facing the above error.
请让我知道我是否正确实施了它以及为什么我面临上述错误。
-Ryan M -瑞安 M
I'm using the 1.1.1
version of Allure Adaptor for Robot Framework and the severity is picked from the test case tags and added as a label under the test-case
element of the report.我正在使用
1.1.1
版本的 Allure Adapter for Robot Framework,严重性是从测试用例标签中挑选出来的,并作为标签添加到报告的test-case
元素下。
However, it seems that Allure 2.6.0
is also expecting a valid value for the severity
attribute of the test-case
element.但是,似乎 Allure
2.6.0
也期待test-case
元素的severity
属性的有效值。
In order to use Allure2 with the current reports I have altered AllureListener.py
to also add the severity to the test case:为了在当前报告中使用 Allure2,我更改了
AllureListener.py
以将严重性添加到测试用例中:
elif tag in SEVERITIES:
test.severity = tag
test.labels.append(TestLabel(
name='severity',
value=tag
))
If your output.xml has severity = None
for any testcase then the allure-robotframework-adaptor will give the error that you have mentioned.如果您的 output.xml 对于任何测试用例都具有
severity = None
那么 allure-robotframework-adaptor 将给出您提到的错误。 Creating TestCase()
object with severity=''
in start_suitesetup
method of AllureListener.py
will do the trick.创建
TestCase()
与对象severity=''
在start_suitesetup
的方法AllureListener.py
将达到目的。
def start_suitesetup(self, name, attributes):
....
....
test = TestCase(name=name,
description=description,
start=now(),
attachments=[],
labels=[],
parameters=[],
steps=[],
severity='')
How to create the Allure reports in Robot Framework ?如何在 Robot Framework 中创建 Allure 报告?
Initially, Download the Command line and UNzip the file and save the path of the bin folder in environment.最初,下载命令行并解压缩文件并将 bin 文件夹的路径保存在环境中。
Link : http://repo.maven.apache.org/maven2/io/qameta/allure/allure-commandline/2.8.0/allure-commandline-2.8.0.zip链接: http : //repo.maven.apache.org/maven2/io/qameta/allure/allure-commandline/2.8.0/allure-commandline-2.8.0.zip
Unzip the above file then put it in the Environment folder.解压上述文件,然后将其放入 Environment 文件夹中。
Then Pip install the below modules然后 Pip 安装以下模块
In robot file, Add the Library in Settings like, Example :在机器人文件中,在设置中添加库,例如,示例:
Library AllureReportLibrary D:\\eclipse\\RobotFramework\\results库 AllureReportLibrary D:\\eclipse\\RobotFramework\\results
Then Use the Below commands to run the robot code.然后使用以下命令运行机器人代码。
robot --listener allure_robotframework;D:\\eclipse\\RobotFramework\\results Example.txt机器人 --listener allure_robotframework;D:\\eclipse\\RobotFramework\\results Example.txt
Finally,最后,
Generate the HTML file by,生成 HTML 文件,
allure generate D:\\eclipse\\RobotFramework\\results诱惑生成 D:\\eclipse\\RobotFramework\\results
Note : Use the same path what you used in the previous command to generate the HTml.file.注意:使用您在上一个命令中使用的相同路径来生成 HTml.file。 and Open in Mozhila FireFox.
并在 Mozhila FireFox 中打开。 It wont be work in Chrome.
它不会在 Chrome 中工作。 I dont know exactly why.
我不知道究竟是为什么。
Regards,问候,
Vijay维杰
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.