resultbuilder
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.
Source code in src/robot/result/resultbuilder.py
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 |
|
__init__(source, include_keywords=True, flattened_keywords=None)
¶
: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.
Source code in src/robot/result/resultbuilder.py
ExecutionResult(*sources, **options)
¶
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.