Output.xml doesn't get updated after every test case run during the test suite execution

I am trying to execute a test suite using a test runner. I am also used RobotTestListener. I am trying to get the output.xml file after each test case execution while running a test suite using a test runner. How can we have the output.xml updated after every test execution

Hi Akash,

The output.xml doesn’t get written until after the test suite has ended, so you can’t really do what your asking.

You could however:

  • run each test individually the the -t option on the command line, let the test finish and then using an external process collect the output.xml for that test before running the next test
  • use the robot framework api in your listener to get the detail that would be in the output.xml.
    e.g Listener version 3’s end_test has 2 arguments data and result, see the api documentation for robot.result.model.TestCase, gives you status and message as well as body, where you’ll find the top level keywords of the test and their individual statuses.
    Use the to_dict() method to make it easier to find where things are in the test case result

Hopefully that helps,

Dave.

2 Likes