简体   繁体   中英

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. 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. 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 .

The log.html template file was also changed to get the desired output like above in log.html file. But I am not finding, where to change to get the desired in output.xml file. The output.xml file still has the format like 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. 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. 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 . 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

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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