简体   繁体   English

如何从 Robot Framework 输出更改 output.xml 的结构

[英]How to change the structure of output.xml from Robot Framework output

We are passing three text files to pybot and the output generated is in the hierarchical format.我们将三个文本文件传递给 pybot,生成的输出采用分层格式。 For Example, in Test Statistics section of the report.html file, under Statistics by Suite, Test 1 & Test 2 & Test 3.Test 1 is observed.例如,在report.html 文件的Test Statistics 部分中,在Statistics by Suite 下,观察到Test 1 & Test 2 & Test 3.Test 1 It was changed to display just Test 1 by editing the report.html template file under /usr/local/lib/python2.7/dist-packages/robot/htmldata/rebot .通过编辑 /usr/local/lib/python2.7/dist-packages/robot/htmldata/rebot 下的 report.html 模板文件,将其更改为仅显示测试 1。

The log.html template file was also changed to get the desired output like above in log.html file. log.html 模板文件也进行了更改,以在 log.html 文件中获得上述所需的输出。 But I am not finding, where to change to get the desired in output.xml file.但我没有找到,在哪里更改以获得所需的 output.xml 文件。 The output.xml file still has the format like Test 1 & Test 2 & Test 3.Test 1 . output.xml 文件仍然具有类似 Test 1 & Test 2 & Test 3.Test 1 的格式。 Could someone help to resolve this ?有人可以帮助解决这个问题吗?

There is no way to modify the format of the output.xml file that was generated by robot.无法修改robot 生成的output.xml 文件的格式。 You have a couple of choices.你有几个选择。

First, you can post-process output.xml with xslt or any other tool to transform it into whatever format you want.首先,您可以使用 xslt 或任何其他工具对 output.xml 进行后处理,以将其转换为您想要的任何格式。 It's a very simple structure that is easy to parse.这是一个非常简单的结构,很容易解析。

Your second option is to ignore the output.xml and write your own using the listener interface .您的第二个选择是忽略 output.xml 并使用侦听器接口编写您自己的。 Through the listener interface you can get a callback for every suite, testcase and keyword where you can write your own output in whatever format you like.通过侦听器接口,您可以获得每个套件、测试用例和关键字的回调,您可以在其中以您喜欢的任何格式编写自己的输出。

C:\\Users\\tijne\\AppData\\Local\\Programs\\Python\\Python38\\Lib\\site-packages\\robot\\htmldata\\rebot C:\\Users\\tijne\\AppData\\Local\\Programs\\Python\\Python38\\Lib\\site-packages\\robot\\htmldata\\rebot

在此处输入图片说明

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

相关问题 机器人框架中的output.xml文件是如何生成的 - How is the output.xml file generated in robot framework 在 Robot Framework 中的 Suite Teardown 之前解析 output.xml - Parse output.xml before Suite Teardown in Robot Framework 如何在log.html和output.xml中向ROBOT Framework测试统计信息添加一些外部链接? - How to add some external links to ROBOT Framework Test Statistics in log.html and output.xml? Allure 无法读取由机器人框架中的 AllureReportLibrary 生成的 output.xml 文件 - Allure not able to read output.xml file generated by AllureReportLibrary in Robot Framework 有没有办法在机器人框架中测试完成后在电子邮件中发送log.html,report.html和output.xml? - Is there a way to send log.html,report.html and output.xml in email after test completion in robot-framework? 解析机器人框架的输出xml - Parse Robot Framework's output xml Robot Framework:如何将控制台输出重定向到文件 - Robot Framework: How to redirect console output to file Robot Framework-pybot命令输出 - Robot Framework - pybot command output 读取和更新 XML 中的字母数字值并生成新的 output.xml 文件时出现问题 - Issue while reading and updating an alphanumeric value in XML and generating new output.xml file 如何使用 python 比较机器人框架的数据输出 - How can i compare data output from robot framework by using python
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM