Implements parsing execution results from XML output files.
The main public API of this package consists of the ExecutionResult()
factory method, that returns Result
objects, and of the ResultVisitor
abstract class, that eases further processing the results. It is recommended to import these public entry-points via the robot.api
package like in the example below.
The model objects defined in the robot.result.model
module are also part of the public API. They are used inside the Result
object, and they can also be inspected and modified as part of the normal test execution by using pre-Rebot modifiers and listeners. These model objects are not exposed via robot.api
, but they can be imported from robot.result
if needed.
#!/usr/bin/env python """Usage: check_test_times.py seconds inpath [outpath] Reads test execution result from an output XML file and checks that no test took longer than given amount of seconds to execute. Optional `outpath` specifies where to write processed results. If not given, results are written over the original file. """ import sys from robot.api import ExecutionResult, ResultVisitor from robot.result.model import TestCase class ExecutionTimeChecker(ResultVisitor): def __init__(self, max_seconds: float): self.max_milliseconds = max_seconds * 1000 def visit_test(self, test: TestCase): if test.status == 'PASS' and test.elapsedtime > self.max_milliseconds: test.status = 'FAIL' test.message = 'Test execution took too long.' def check_tests(seconds, inpath, outpath=None): result = ExecutionResult(inpath) result.visit(ExecutionTimeChecker(float(seconds))) result.save(outpath) if __name__ == '__main__': try: check_tests(*sys.argv[1:]) except TypeError: print(__doc__)Submodules robot.result.configurer module
Bases: SuiteConfigurer
Result suite configured.
Calls suite’s remove_keywords()
and filter_messages()
methods and sets its start and end time based on the given named parameters.
base_config
is forwarded to robot.model.SuiteConfigurer
that will do further configuration based on them.
Implements traversing through suites.
Can be overridden to allow modifying the passed in suite
without calling start_suite()
or end_suite()
nor visiting child suites, tests or setup and teardown at all.
Bases: object
Represents errors occurred during the execution of tests.
An error might be, for example, that importing a library has failed.
Bases: object
Test execution results.
Can be created based on XML output files using the ExecutionResult()
factory method. Also returned by the robot.running.TestSuite.run
method.
Execution statistics.
Statistics are created based on the contained suite
and possible configuration
.
Statistics are created every time this property is accessed. Saving them to a variable is thus often a good idea to avoid re-creating them unnecessarily:
from robot.api import ExecutionResult result = ExecutionResult('output.xml') result.configure(stat_config={'suite_stat_level': 2, 'tag_stat_combine': 'tagANDanother'}) stats = result.statistics print(stats.total.failed) print(stats.total.passed) print(stats.tags.combined[0].total)
Execution return code.
By default, returns the number of failed tests or tasks (max 250), but can be configured
to always return 0.
Configures the result object and objects it contains.
status_rc – If set to False
, return_code
always returns 0.
suite_config – A dictionary of configuration options passed to configure()
method of the contained suite
.
stat_config – A dictionary of configuration options used when creating statistics
.
Construct a result object from JSON data.
source – JSON data as a string or bytes containing the data directly, an open file object where to read the data from, or a path (pathlib.Path
or string) to a UTF-8 encoded file to read.
include_keywords – When False
, keyword and control structure information is not parsed. This can save considerable amount of time and memory. New in RF 7.3.2.
flattened_keywords – List of patterns controlling what keywords and control structures to flatten. See the documentation of the --flattenkeywords
option for more details. New in RF 7.3.2.
rpa – Setting rpa
either to True
(RPA mode) or False
(test automation) sets the execution mode explicitly. By default, the mode is got from the parsed data.
Result
instance.
The data can contain either:
full result data (contains suite information, execution errors, etc.) got, for example, from the to_json()
method, or
only suite information got, for example, from result.testsuite.TestSuite.to_json
.
statistics
are populated automatically based on suite information and thus ignored if they are present in the data.
New in Robot Framework 7.2.
Serialize results into JSON.
The file
parameter controls what to do with the resulting JSON data. It can be:
None
(default) to return the data as a string,
an open file object where to write the data to, or
a path (pathlib.Path
or string) to a file where to write the data using UTF-8 encoding.
The include_statistics
controls including statistics information in the resulting JSON data. Statistics are not needed if the serialized JSON data is converted back to a Result
object, but they can be useful for external tools.
The remaining optional parameters are used for JSON formatting. They are passed directly to the underlying json module, but the defaults differ from what json
uses.
New in Robot Framework 7.2.
Save results as XML or JSON file.
target – Target where to save results to. Can be a path (pathlib.Path
or str
) or an open file object. If omitted, uses the source
which overwrites the original file.
legacy_output – Save XML results in Robot Framework 6.x compatible format. New in Robot Framework 7.0.
File type is got based on the target
. The type is JSON if the target
is a path that has a .json
suffix or if it is an open file that has a name
attribute with a .json
suffix. Otherwise, the type is XML.
It is also possible to use to_json()
for JSON serialization. Compared to this method, it allows returning the JSON in addition to writing it into a file, and it also supports customizing JSON formatting.
Support for saving results in JSON is new in Robot Framework 7.0. Originally only suite information was saved in that case, but starting from Robot Framework 7.2, also JSON results contain full result data including, for example, execution errors and statistics.
An entry point to visit the whole result object.
visitor – An instance of ResultVisitor
.
Visitors can gather information, modify results, etc. See result
package for a simple usage example.
Notice that it is also possible to call result.suite.visit
if there is no need to visit the contained statistics
or errors
.
Internal usage only.
Set execution mode based on other result. Internal usage only.
Bases: Result
Combined results of multiple test executions.
Bases: SuiteVisitor
Called when a suite starts. Default implementation does nothing.
Can return explicit False
to stop visiting.
Implements traversing through tests.
Can be overridden to allow modifying the passed in test
without calling start_test()
or end_test()
nor visiting the body of the test.
Bases: object
Bases: object
Bases: object
Bases: SuiteVisitor
Called when a suite starts. Default implementation does nothing.
Can return explicit False
to stop visiting.
Called when a keyword starts.
By default, calls start_body_item()
which, by default, does nothing.
Can return explicit False
to stop visiting.
Called, by default, when keywords, messages or control structures start.
More specific start_keyword()
, start_message()
, :meth:`start_for, etc. can be implemented to visit only keywords, messages or specific control structures.
Can return explicit False
to stop visiting. Default implementation does nothing.
Bases: SuiteVisitor
Called when a suite starts. Default implementation does nothing.
Can return explicit False
to stop visiting.
Called when a keyword starts.
By default, calls start_body_item()
which, by default, does nothing.
Can return explicit False
to stop visiting.
Bases: SuiteVisitor
Implements visiting messages.
Can be overridden to allow modifying the passed in msg
without calling start_message()
or end_message()
.
Bases: SuiteVisitor
, ABC
Bases: KeywordRemover
Called when a test starts. Default implementation does nothing.
Can return explicit False
to stop visiting.
Called, by default, when keywords, messages or control structures start.
More specific start_keyword()
, start_message()
, :meth:`start_for, etc. can be implemented to visit only keywords, messages or specific control structures.
Can return explicit False
to stop visiting. Default implementation does nothing.
Called when an IF/ELSE structure starts.
By default, calls start_body_item()
which, by default, does nothing.
Can return explicit False
to stop visiting.
Called when an IF/ELSE branch starts.
By default, calls start_body_item()
which, by default, does nothing.
Can return explicit False
to stop visiting.
Called when a TRY/EXCEPT structure starts.
By default, calls start_body_item()
which, by default, does nothing.
Can return explicit False
to stop visiting.
Called when TRY, EXCEPT, ELSE or FINALLY branches start.
By default, calls start_body_item()
which, by default, does nothing.
Can return explicit False
to stop visiting.
Bases: KeywordRemover
Called when a suite starts. Default implementation does nothing.
Can return explicit False
to stop visiting.
Implements traversing through tests.
Can be overridden to allow modifying the passed in test
without calling start_test()
or end_test()
nor visiting the body of the test.
Implements traversing through keywords.
Can be overridden to allow modifying the passed in kw
without calling start_keyword()
or end_keyword()
nor visiting the body of the keyword
Bases: KeywordRemover
Called when a keyword starts.
By default, calls start_body_item()
which, by default, does nothing.
Can return explicit False
to stop visiting.
Bases: KeywordRemover
Called when a keyword starts.
By default, calls start_body_item()
which, by default, does nothing.
Can return explicit False
to stop visiting.
Bases: KeywordRemover
, ABC
Bases: LoopItemsRemover
Called when a FOR loop starts.
By default, calls start_body_item()
which, by default, does nothing.
Can return explicit False
to stop visiting.
Bases: LoopItemsRemover
Called when a WHILE loop starts.
By default, calls start_body_item()
which, by default, does nothing.
Can return explicit False
to stop visiting.
Bases: KeywordRemover
Called when a keyword starts.
By default, calls start_body_item()
which, by default, does nothing.
Can return explicit False
to stop visiting.
Bases: SuiteVisitor
Called when a suite starts. Default implementation does nothing.
Can return explicit False
to stop visiting.
Called when a test starts. Default implementation does nothing.
Can return explicit False
to stop visiting.
Called when a keyword starts.
By default, calls start_body_item()
which, by default, does nothing.
Can return explicit False
to stop visiting.
Implements visiting messages.
Can be overridden to allow modifying the passed in msg
without calling start_message()
or end_message()
.
Bases: object
Bases: SuiteVisitor
Called when a suite starts. Default implementation does nothing.
Can return explicit False
to stop visiting.
Called when a suite ends. Default implementation does nothing.
Implements traversing through tests.
Can be overridden to allow modifying the passed in test
without calling start_test()
or end_test()
nor visiting the body of the test.
Bases: ResultVisitor
Called when a suite starts. Default implementation does nothing.
Can return explicit False
to stop visiting.
Called, by default, when keywords, messages or control structures start.
More specific start_keyword()
, start_message()
, :meth:`start_for, etc. can be implemented to visit only keywords, messages or specific control structures.
Can return explicit False
to stop visiting. Default implementation does nothing.
Module implementing result related model objects.
During test execution these objects are created internally by various runners. At that time they can be inspected and modified by listeners.
When results are parsed from XML output files after execution to be able to create logs and reports, these objects are created by the ExecutionResult()
factory method. At that point they can be inspected and modified by pre-Rebot modifiers.
The ExecutionResult()
factory method can also be used by custom scripts and tools. In such usage it is often easiest to inspect and modify these objects using the visitor interface
.
If classes defined here are needed, for example, as type hints, they can be imported via the robot.running
module.
Bases: BaseBody
[Keyword, For, While, Group, If, Try, Var, Return, Continue, Break, Message, Error]
alias of Break
alias of Continue
alias of Error
alias of For
alias of Group
alias of If
alias of Keyword
alias of Message
alias of Return
alias of Try
alias of Var
alias of While
Bases: BaseBranches
[Keyword, For, While, Group, If, Try, Var, Return, Continue, Break, Message, Error, IT
]
alias of Keyword
alias of Message
Bases: BaseIterations
[Keyword, For, While, Group, If, Try, Var, Return, Continue, Break, Message, Error, FW
]
alias of Keyword
alias of Message
Bases: Message
Serialize this object into a dictionary.
The object can be later restored by using the from_dict()
method.
With robot.running
model objects new in Robot Framework 6.1, with robot.result
new in Robot Framework 7.0.
Bases: object
Execution start time as a datetime
or as a None
if not set.
If start time is not set, it is calculated based end_time
and elapsed_time
if possible.
Can be set either directly as a datetime
or as a string in ISO 8601 format.
New in Robot Framework 6.1. Heavily enhanced in Robot Framework 7.0.
Execution end time as a datetime
or as a None
if not set.
If end time is not set, it is calculated based start_time
and elapsed_time
if possible.
Can be set either directly as a datetime
or as a string in ISO 8601 format.
New in Robot Framework 6.1. Heavily enhanced in Robot Framework 7.0.
Total execution time as a timedelta
.
If not set, calculated based on start_time
and end_time
if possible. If that fails, calculated based on the elapsed time of child items.
Can be set either directly as a timedelta
or as an integer or a float representing seconds.
New in Robot Framework 6.1. Heavily enhanced in Robot Framework 7.0.
Execution start time as a string or as a None
if not set.
The string format is %Y%m%d %H:%M:%S.%f
.
Considered deprecated starting from Robot Framework 7.0. start_time
should be used instead.
Execution end time as a string or as a None
if not set.
The string format is %Y%m%d %H:%M:%S.%f
.
Considered deprecated starting from Robot Framework 7.0. end_time
should be used instead.
Total execution time in milliseconds.
Considered deprecated starting from Robot Framework 7.0. elapsed_time
should be used instead.
True
when status
is ‘PASS’, False
otherwise.
True
when status
is ‘FAIL’, False
otherwise.
True
when status
is ‘SKIP’, False
otherwise.
Setting to False
value is ambiguous and raises an exception.
True
when status
is ‘NOT RUN’, False
otherwise.
Setting to False
value is ambiguous and raises an exception.
Bases: ForIteration
, StatusMixin
, DeprecatedAttributesMixin
alias of Body
Serialize this object into a dictionary.
The object can be later restored by using the from_dict()
method.
With robot.running
model objects new in Robot Framework 6.1, with robot.result
new in Robot Framework 7.0.
Bases: For
, StatusMixin
, DeprecatedAttributesMixin
alias of ForIteration
alias of Iterations
[ForIteration
]
Serialize this object into a dictionary.
The object can be later restored by using the from_dict()
method.
With robot.running
model objects new in Robot Framework 6.1, with robot.result
new in Robot Framework 7.0.
Bases: WhileIteration
, StatusMixin
, DeprecatedAttributesMixin
alias of Body
Serialize this object into a dictionary.
The object can be later restored by using the from_dict()
method.
With robot.running
model objects new in Robot Framework 6.1, with robot.result
new in Robot Framework 7.0.
Bases: While
, StatusMixin
, DeprecatedAttributesMixin
alias of WhileIteration
alias of Iterations
[WhileIteration
]
Serialize this object into a dictionary.
The object can be later restored by using the from_dict()
method.
With robot.running
model objects new in Robot Framework 6.1, with robot.result
new in Robot Framework 7.0.
Bases: Group
, StatusMixin
, DeprecatedAttributesMixin
alias of Body
Serialize this object into a dictionary.
The object can be later restored by using the from_dict()
method.
With robot.running
model objects new in Robot Framework 6.1, with robot.result
new in Robot Framework 7.0.
Bases: IfBranch
, StatusMixin
, DeprecatedAttributesMixin
alias of Body
Serialize this object into a dictionary.
The object can be later restored by using the from_dict()
method.
With robot.running
model objects new in Robot Framework 6.1, with robot.result
new in Robot Framework 7.0.
Bases: If
, StatusMixin
, DeprecatedAttributesMixin
alias of IfBranch
Serialize this object into a dictionary.
The object can be later restored by using the from_dict()
method.
With robot.running
model objects new in Robot Framework 6.1, with robot.result
new in Robot Framework 7.0.
Bases: TryBranch
, StatusMixin
, DeprecatedAttributesMixin
alias of Body
Serialize this object into a dictionary.
The object can be later restored by using the from_dict()
method.
With robot.running
model objects new in Robot Framework 6.1, with robot.result
new in Robot Framework 7.0.
Bases: Try
, StatusMixin
, DeprecatedAttributesMixin
alias of TryBranch
Serialize this object into a dictionary.
The object can be later restored by using the from_dict()
method.
With robot.running
model objects new in Robot Framework 6.1, with robot.result
new in Robot Framework 7.0.
Bases: Var
, StatusMixin
, DeprecatedAttributesMixin
alias of Body
Child keywords and messages as a Body
object.
Typically empty. Only contains something if running VAR has failed due to a syntax error or listeners have logged messages or executed keywords.
Serialize this object into a dictionary.
The object can be later restored by using the from_dict()
method.
With robot.running
model objects new in Robot Framework 6.1, with robot.result
new in Robot Framework 7.0.
Bases: Return
, StatusMixin
, DeprecatedAttributesMixin
alias of Body
Child keywords and messages as a Body
object.
Typically empty. Only contains something if running RETURN has failed due to a syntax error or listeners have logged messages or executed keywords.
Serialize this object into a dictionary.
The object can be later restored by using the from_dict()
method.
With robot.running
model objects new in Robot Framework 6.1, with robot.result
new in Robot Framework 7.0.
Bases: Continue
, StatusMixin
, DeprecatedAttributesMixin
alias of Body
Child keywords and messages as a Body
object.
Typically empty. Only contains something if running CONTINUE has failed due to a syntax error or listeners have logged messages or executed keywords.
Serialize this object into a dictionary.
The object can be later restored by using the from_dict()
method.
With robot.running
model objects new in Robot Framework 6.1, with robot.result
new in Robot Framework 7.0.
Bases: Break
, StatusMixin
, DeprecatedAttributesMixin
alias of Body
Child keywords and messages as a Body
object.
Typically empty. Only contains something if running BREAK has failed due to a syntax error or listeners have logged messages or executed keywords.
Serialize this object into a dictionary.
The object can be later restored by using the from_dict()
method.
With robot.running
model objects new in Robot Framework 6.1, with robot.result
new in Robot Framework 7.0.
Bases: Error
, StatusMixin
, DeprecatedAttributesMixin
alias of Body
Messages as a Body
object.
Typically contains the message that caused the error.
Serialize this object into a dictionary.
The object can be later restored by using the from_dict()
method.
With robot.running
model objects new in Robot Framework 6.1, with robot.result
new in Robot Framework 7.0.
Bases: Keyword
, StatusMixin
Represents an executed library or user keyword.
alias of Body
Name of the library or resource containing this keyword.
Original name of keyword with embedded arguments.
Keyword body as a Body
object.
Body can consist of child keywords, messages, and control structures such as IF/ELSE.
Keyword’s messages.
Starting from Robot Framework 4.0 this is a list generated from messages in body
.
Keyword name in format owner.name
.
Just name
if owner
is not set. In practice this is the case only with user keywords in the suite file.
Cannot be set directly. Set name
and owner
separately instead.
Notice that prior to Robot Framework 7.0, the name
attribute contained the full name and keyword and owner names were in kwname
and libname
, respectively.
Deprecated since Robot Framework 7.0. Use name
instead.
Deprecated since Robot Framework 7.0. Use owner
instead.
Deprecated since Robot Framework 7.0. Use source_name
instead.
Keyword setup as a Keyword
object.
See teardown
for more information. New in Robot Framework 7.0.
Check does a keyword have a setup without creating a setup object.
See has_teardown
for more information. New in Robot Framework 7.0.
Keyword teardown as a Keyword
object.
Teardown can be modified by setting attributes directly:
keyword.teardown.name = 'Example' keyword.teardown.args = ('First', 'Second')
Alternatively the config()
method can be used to set multiple attributes in one call:
keyword.teardown.config(name='Example', args=('First', 'Second'))
The easiest way to reset the whole teardown is setting it to None
. It will automatically recreate the underlying Keyword
object:
This attribute is a Keyword
object also when a keyword has no teardown but in that case its truth value is False
. If there is a need to just check does a keyword have a teardown, using the has_teardown
attribute avoids creating the Keyword
object and is thus more memory efficient.
New in Robot Framework 4.0. Earlier teardown was accessed like keyword.keywords.teardown
. has_teardown
is new in Robot Framework 4.1.2.
Check does a keyword have a teardown without creating a teardown object.
A difference between using if kw.has_teardown:
and if kw.teardown:
is that accessing the teardown
attribute creates a Keyword
object representing a teardown even when the keyword actually does not have one. This typically does not matter, but with bigger suite structures having lots of keywords it can have a considerable effect on memory usage.
New in Robot Framework 4.1.2.
Keyword tags as a Tags
object.
Serialize this object into a dictionary.
The object can be later restored by using the from_dict()
method.
With robot.running
model objects new in Robot Framework 6.1, with robot.result
new in Robot Framework 7.0.
Bases: TestCase
[Keyword
], StatusMixin
Represents results of a single test case.
See the base class for documentation of attributes not documented here.
alias of Body
alias of Keyword
True
when status
is ‘NOT RUN’, False
otherwise.
Setting to False
value is ambiguous and raises an exception.
Test body as a Body
object.
Serialize this object into a dictionary.
The object can be later restored by using the from_dict()
method.
With robot.running
model objects new in Robot Framework 6.1, with robot.result
new in Robot Framework 7.0.
Create this object based on data in a dictionary.
Data can be got from the to_dict()
method or created externally.
With robot.running
model objects new in Robot Framework 6.1, with robot.result
new in Robot Framework 7.0.
Bases: TestSuite
[Keyword
, TestCase
], StatusMixin
Represents results of a single test suite.
See the base class for documentation of attributes not documented here.
alias of TestCase
alias of Keyword
Possible suite setup or teardown error message.
True
if no test has failed but some have passed, False
otherwise.
True
if any test has failed, False
otherwise.
True
if there are no passed or failed tests, False
otherwise.
True
when status
is ‘NOT RUN’, False
otherwise.
Setting to False
value is ambiguous and raises an exception.
‘PASS’, ‘FAIL’ or ‘SKIP’ depending on test statuses.
If any test has failed, status is ‘FAIL’.
If no test has failed but at least some test has passed, status is ‘PASS’.
If there are no failed or passed tests, status is ‘SKIP’. This covers both the case when all tests have been skipped and when there are no tests.
Suite statistics as a TotalStatistics
object.
Recreated every time this property is accessed, so saving the results to a variable and inspecting it is often a good idea:
stats = suite.statistics print(stats.failed) print(stats.total) print(stats.message)
Combination of message
and stat_message
.
String representation of the statistics
.
Remove keywords based on the given condition.
how – Which approach to use when removing keywords. Either ALL
, PASSED
, FOR
, WUKS
, or NAME:<pattern>
.
For more information about the possible values see the documentation of the --removekeywords
command line option.
Remove log messages below the specified log_level
.
A shortcut to configure a suite using one method call.
Can only be used with the root test suite.
options – Passed to SuiteConfigurer
that will then set suite attributes, call filter()
, etc. as needed.
Example:
suite.configure(remove_keywords='PASSED', doc='Smoke test results.')
Not to be confused with config()
method that suites, tests, and keywords have to make it possible to set multiple attributes in one call.
Internal usage only.
Internal usage only.
Internal usage only.
Serialize this object into a dictionary.
The object can be later restored by using the from_dict()
method.
With robot.running
model objects new in Robot Framework 6.1, with robot.result
new in Robot Framework 7.0.
Create suite based on result data in a dictionary.
data
can either contain only the suite data got, for example, from the to_dict()
method, or it can contain full result data with execution errors and other such information in addition to the suite data. In the latter case only the suite data is used, though.
Support for full result data is new in Robot Framework 7.2.
Create suite based on results in JSON.
The data is given as the source
parameter. It can be:
a string containing the data directly,
an open file object where to read the data from, or
a path (pathlib.Path
or string) to a UTF-8 encoded file to read.
Supports JSON produced by to_json()
that contains only the suite information, as well as full result JSON that contains also execution errors and other information. In the latter case errors and all other information is silently ignored, though. If that is a problem, ExecutionResult
should be used instead.
Support for full result JSON is new in Robot Framework 7.2.
Serialize suite into XML.
The format is the same that is used with normal output.xml files, but the <robot>
root node is omitted and the result contains only the <suite>
structure.
The file
parameter controls what to do with the resulting XML data. It can be:
None
(default) to return the data as a string,
an open file object where to write the data to, or
a path (pathlib.Path
or string) to a file where to write the data using UTF-8 encoding.
A serialized suite can be recreated by using the from_xml()
method.
New in Robot Framework 7.0.
Create suite based on results in XML.
The data is given as the source
parameter. It can be:
a string containing the data directly,
an open file object where to read the data from, or
a path (pathlib.Path
or string) to a UTF-8 encoded file to read.
Supports both normal output.xml files and files containing only the <suite>
structure created, for example, with the to_xml()
method. When using normal output.xml files, possible execution errors listed in <errors>
are silently ignored. If that is a problem, ExecutionResult
should be used instead.
New in Robot Framework 7.0.
Bases: object
Deprecated.
Deprecated.
Deprecated.
Deprecated.
Deprecated.
Deprecated.
Deprecated.
Deprecated.
Factory method to constructs Result
objects.
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.
merge – When True
and multiple sources are given, results are merged instead of combined.
include_keywords – When False
, keyword and control structure information is not parsed. This can save considerable amount of time and memory.
flattened_keywords – List of patterns controlling what keywords and control structures to flatten. See the documentation of the --flattenkeywords
option for more details.
rpa – Setting rpa
either to True
(RPA mode) or False
(test automation) sets the execution mode explicitly. By default, the mode is got from processed output files and conflicting modes cause an error.
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 robot.api
package. See the robot.result
package for a usage example.
Bases: object
Builds Result
objects based on XML output files.
Instead of using this builder directly, it is recommended to use the ExecutionResult()
factory method.
source – Path to the XML output file to build Result
objects from.
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.
flattened_keywords – List of patterns controlling what keywords and control structures to flatten. See the documentation of the --flattenkeywords
option for more details.
Bases: SuiteVisitor
Called when a suite ends. Default implementation does nothing.
Implements traversing through tests.
Can be overridden to allow modifying the passed in test
without calling start_test()
or end_test()
nor visiting the body of the test.
Implements traversing through keywords.
Can be overridden to allow modifying the passed in kw
without calling start_keyword()
or end_keyword()
nor visiting the body of the keyword
Bases: SuiteVisitor
Implements traversing through tests.
Can be overridden to allow modifying the passed in test
without calling start_test()
or end_test()
nor visiting the body of the test.
Implements traversing through keywords.
Can be overridden to allow modifying the passed in kw
without calling start_keyword()
or end_keyword()
nor visiting the body of the keyword
Visitors can be used to easily traverse result structures.
This module contains ResultVisitor
for traversing the whole Result
object. It extends SuiteVisitor
that contains visiting logic for the test suite structure.
Bases: SuiteVisitor
Abstract class to conveniently travel Result
objects.
A visitor implementation can be given to the visit()
method of a result object. This will cause the result object to be traversed and the visitor’s visit_x()
, start_x()
, and end_x()
methods to be called for each suite, test, keyword and message, as well as for errors, statistics, and other information in the result object. See methods below for a full list of available visitor methods.
See the result package level
documentation for more information about handling results and a concrete visitor example. For more information about the visitor algorithm see documentation in robot.model.visitor
module.
Bases: object
Bases: object
Bases: ElementHandler
Bases: ElementHandler
Bases: ElementHandler
Bases: ElementHandler
Bases: ElementHandler
Bases: ElementHandler
Bases: ElementHandler
Bases: ElementHandler
Bases: ElementHandler
Bases: ElementHandler
Bases: ElementHandler
Bases: ElementHandler
Bases: ElementHandler
Bases: ElementHandler
Bases: ElementHandler
Bases: ElementHandler
Bases: ElementHandler
Bases: ElementHandler
Bases: ElementHandler
Bases: MessageHandler
Bases: ElementHandler
Bases: ElementHandler
Bases: ElementHandler
Bases: ElementHandler
Bases: ElementHandler
Bases: ElementHandler
Bases: ElementHandler
Bases: ElementHandler
Bases: ElementHandler
Bases: ElementHandler
Bases: ElementHandler
Bases: ElementHandler
Bases: ElementHandler
Bases: ElementHandler
Bases: ElementHandler
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4