'Is there a way to generate robot framework output.xml file from log.html

Is there a way to generate robot framework output.xml file from log.html I work in regression team where we store log.html as to have future reference, but if i do want to have XML file back, is it possible to generate from log.html

REBOT is to generate log and reports from xml. Do we have any similar modules or packages that we can use to retrieve xml from log.html



Solution 1:[1]

Is there a way to generate robot framework output.xml file from log.html

Robot does not provide a way to do that. Though, since log.html is HTML, you can write your own tool to do the conversion.

I work in regression team where we store log.html as to have future reference

The smarter solution is to store the XML since that is the source of truth for test results. By storing it, you can easily regenerate the log.html and report.html files whenever you need them.

You can use robot's rebot command to recreate the log and report files:

$ python -m robot.rebot output.xml 
Log:     /tmp/log.html
Report:  /tmp/report.html

Solution 2:[2]

We can use the below one.

rebot --name 'automation' -o results/output.xml -d results/results/result_xml/excel*.xml

you need to run this from where your log files present

Solution 3:[3]

In general, Prefect manages the state of your flows and tasks, therefore you shouldn't have to build your own exception handlers. Did you know that Prefect has state handlers that provide this functionality out of the box? Here is an example that sends a full exception traceback via a Slack message.

Additionally, in Prefect <= 1.0 you can't use if/else statements directly in your flow, the same with print and log statements. The Flow constructor can only call tasks and set dependencies. This means that you would have to move this logic to separate functions that you can decorate with @task. You can replace the if/else statements with conditional tasks such as case.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Suraj Rao
Solution 3 Anna Geller