robot.result.resultbuilder
¶
ExecutionResult
¶
Factory method to constructs :class:~.executionresult.Result
objects.
:param sources: XML or JSON source(s) containing execution results.
Can be specified as paths (pathlib.Path
or str
), opened file
objects, or strings/bytes containing XML/JSON directly.
:param options: Configuration options.
Using merge=True
causes multiple results to be combined so that
tests in the latter results replace the ones in the original.
Setting rpa
either to True
(RPA mode) or False
(test
automation) sets execution mode explicitly. By default, it is got
from processed output files and conflicting modes cause an error.
Other options are passed directly to the
:class:ExecutionResultBuilder
object used internally.
:returns: :class:~.executionresult.Result
instance.
A source is considered to be JSON in these cases:
- It is a path with a .json
suffix.
- It is an open file that has a name
attribute with a .json
suffix.
- It is string or bytes starting with {
and ending with }
.
This method should be imported by external code via the :mod:robot.api
package. See the :mod:robot.result
package for a usage example.
Source code in src/robot/result/resultbuilder.py
ExecutionResultBuilder
¶
Builds :class:~.executionresult.Result
objects based on XML output files.
Instead of using this builder directly, it is recommended to use the
:func:ExecutionResult
factory method.
:param source: Path to the XML output file to build
:class:~.executionresult.Result
objects from.
:param include_keywords: Controls whether to include keywords and control
structures like FOR and IF in the result or not. They are not needed
when generating only a report.
:param flattened_keywords: List of patterns controlling what keywords
and control structures to flatten. See the documentation of
the --flattenkeywords
option for more details.