Output.xml failed: ParseError: not well-formed (invalid token)

I always got error “output.xml failed: ParseError: not well-formed (invalid token)” now.
output.xml is 0 length, and no report.html generated.
How to solve this please?

Hi Hans,

Usually this sort of error happens when you try to open these files before robot framework has not yet finished executing and completed writing the file.

If this is not the issue, then you probably need to give an explanation of what you are doing that’s causing the error, and also any errors you are getting on the command line output when robot framework runs.

It would also be helpful if you can provide an example robot file that we can run that results in output.xml being 0 bytes so we can try and reproduce it.


hi Dave, thank you for your reply.
I have about 75 test cases and ran very well before, just got this error this week.
All the test cases will run one by one, and there will be some failure.
In the end, when Robot Framework want to write down the test report, it report error.
And when I check the folder, output.xml file length is 0, there is no report.html or log.html.
Following are from the Robot Framework terminal:
Test MMTest                                                            | FAIL |
75 tests, 64 passed, 11 failed
Output:  C:\test-automation\mm-test-automation\results\output.xml
[ ERROR ] Reading XML source 'C:\test-automation\mm-test-automation\results\output.xml' failed: ParseError: not well-formed (invalid token): line 257, column 0`Preformatted text`

Well your file does have content. Where do you see the file as “0 bytes”? Could it be that your editor cannot open the file?

I suspect that your output.xml is too large and either was broken on the writting, or is messing the reading.


I often have this when test is stopped manually with ctrl+c and debugger/run is unplugged in a hard way. Means the file is not complete or readable, so no log or report can be build.

As per Guilherme remark on the line, have you try to open it and check what’s happening at the mentioned line (specific test, characters or else)?

Have you try to run just one test, just the passed, or made a - - rerunfailed on the 11 ones see if the problem occurs also?
Goal is to focus maybe on a problematic test/content.

Maybe try also to change the outputdir, may it’s be an access rights/disk space issue?


1 Like

in the folder, windows explore shows 0.
when I opened it with notepad++, nothing in it

What there any changes in versions?
What are the versions you use for Python, RobotFramework, Libraries?
Do you a modifier (using listener, or API)?

1 Like