Robot Framework output XML schema¶
Introduction¶
While Robot Framework is running tests, it generates an XML output file
containing all information about the execution. After execution is over it
creates, by default, log and report files using
rebot tool
internally. The same rebot
functionality can also be used externally
afterwards both as a standalone tool and
programmatically.
This document describes the format of the output file in high level and in the same folder there are detailed XML schema definition (XSD) files that can be used for validating that an XML file is Robot Framework compatible. The output file format can be useful both for people interested in parsing the output and for people interested to create Robot Framework compatible outputs.
General structure¶
These are the main elements of the XML output with descriptions of their
sub-elements. Unless stated otherwise, all attributes are optional. Additionally
rebot
does not care of the order of the XML elements, except for the order
of suite, test, and kw elements.
Before Robot Framework 2.9 all elements and attributes were always written to
output, regardless whether they had a value. For example, a keyword that did
not have a documentation would still have an empty <doc>
element and every
keyword without a timeout had an empty timeout
attribute. Starting from
version 2.9 Robot Framework no longer writes empty elements or attributes to
the output XML.
- robot - root element
suite
- root element always has one suite which contains the subsuites and testsstatistics
- statistics contains statistics of the test runerrors
- if there were any errors, they are listed in this element
- suite - suite element, name is given as an attribute
kw
- suite can have two kw elements: setup and teardown, both are optionalsuite
- any number of sub suites in execution ordertest
- any number of tests in execution orderdoc
- optional documentation elementmetadata
- optional suite metadatastatus
- suite has to have a status element
- test - test element, name is given as an attribute
kw
- keywords of the test in execution ordermsg
- optional test messagedoc
- optional test documentationtags
- optional test tagstimeout
- optional test timeout. Before 3.0 this was an attribute.status
- test has to have a status
- kw - keyword element, name is given as an attribute. Type attribute describes the type of keyword. If this attribute is not present, type is assumed to be
kw
. tags
- optional keyword tags (new in 2.9)doc
- optional keyword documentationarguments
- optional keyword argumentsassignment
- possible assignment of keyword's return values to variables, each variable invar
subelement (new in 2.9)kw
- possible sub-keywords in execution ordermsg
- any number of optional keyword messagestimeout
- optional keyword timeout. Before 3.0 this was an attribute.status
- keyword has to have a status
For more details and full list of elements and attributes, please see the XML schema files below.
XML schema definition¶
Available schema files:
- robot-xsd10.xsd - XSD 1.0 compatible version
- robot-xsd11.xsd - XSD 1.1 compatible version
The latter schema file is more complete, but XSD 1.1 is not as widely supported as the 1.0 version.