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’send_test
has 2 argumentsdata
andresult
, see the api documentation for robot.result.model.TestCase, gives youstatus
andmessage
as well asbody
, where you’ll find the top level keywords of the test and their individual statuses.
Use theto_dict()
method to make it easier to find where things are in the test caseresult
Hopefully that helps,
Dave.
2 Likes