Send Output.xml to Xray API - incomplete file

When finalizing a test suite in the robot framework, I created a keyword through Suite Teardown to send to Xray (Jira), via API, the output.xml file with the Suite’s TestResult.
However, the Output.xml file is not yet complete (some TAGs are missing) and therefore I cannot send the file.
Does anyone have any idea how to perform this action via a .robot file?

listener interface has close event that is called with everything should be finished.

Thanks my friend !
And I can call this event by command to be able to use the file before the suite ends ?

When you say “suite ends”, there is no quarantee that test execution has ended. There can still be multiple suites to be executed and thus, output.xml will be still invalid xml when “suite ends” and could be also be locked. This the approach of making a keyword that uploads output.xml in suite teardown will not work.

In order to get the stuff to xray, you either implement a listener that monitors “close” event and does the uploading to xray then … This would typically require python code.

You probably have better changes getting something working by just uploading the output.xml after robot execution has completely stopped. By adding (and probably writing it) your own listener, you can avoid that step. Do read up here: Robot Framework User Guide

And just for the sake of it:

1 Like