Robot Framework
robot.result.executionresult.Result Class Reference

Test execution results. More...

Inheritance diagram for robot.result.executionresult.Result:
robot.result.executionresult.CombinedResult

Public Member Functions

def __init__ (self, source=None, root_suite=None, errors=None, rpa=None)
 
def configure (self, status_rc=True, suite_config=None, stat_config=None)
 Configures the result object and objects it contains. More...
 
def handle_suite_teardown_failures (self)
 Internal usage only. More...
 
def save (self, path=None)
 Save results as a new output XML file. More...
 
def set_execution_mode (self, other)
 Set execution mode based on other result. More...
 
def visit (self, visitor)
 An entry point to visit the whole result object. More...
 

Public Attributes

 errors
 
 generated_by_robot
 
 rpa
 
 source
 
 suite
 

Properties

 return_code = property
 Return code (integer) of test execution. More...
 
 statistics = property
 Test execution statistics. More...
 

Private Member Functions

def return_code (self)
 
def statistics (self)
 

Private Attributes

 _stat_config
 
 _status_rc
 

Detailed Description

Test execution results.

Can be created based on XML output files using the
:func:`~.resultbuilder.ExecutionResult`
factory method. Also returned by the
:meth:`robot.running.TestSuite.run <robot.running.model.TestSuite.run>`
method.

Definition at line 31 of file executionresult.py.

Constructor & Destructor Documentation

◆ __init__()

def robot.result.executionresult.Result.__init__ (   self,
  source = None,
  root_suite = None,
  errors = None,
  rpa = None 
)

Definition at line 33 of file executionresult.py.

Member Function Documentation

◆ configure()

def robot.result.executionresult.Result.configure (   self,
  status_rc = True,
  suite_config = None,
  stat_config = None 
)

Configures the result object and objects it contains.

    :param status_rc: If set to ``False``, :attr:`return_code` always
        returns 0.
    :param suite_config: A dictionary of configuration options passed
        to :meth:`~.result.testsuite.TestSuite.configure` method of
        the contained ``suite``.
    :param stat_config: A dictionary of configuration options used when
        creating :attr:`statistics`.

Definition at line 97 of file executionresult.py.

◆ handle_suite_teardown_failures()

def robot.result.executionresult.Result.handle_suite_teardown_failures (   self)

Internal usage only.

Definition at line 127 of file executionresult.py.

◆ return_code()

def robot.result.executionresult.Result.return_code (   self)
private

Definition at line 82 of file executionresult.py.

◆ save()

def robot.result.executionresult.Result.save (   self,
  path = None 
)

Save results as a new output XML file.

    :param path: Path to save results to. If omitted, overwrites the
        original file.

Definition at line 108 of file executionresult.py.

◆ set_execution_mode()

def robot.result.executionresult.Result.set_execution_mode (   self,
  other 
)

Set execution mode based on other result.

Internal usage only.

Definition at line 132 of file executionresult.py.

◆ statistics()

def robot.result.executionresult.Result.statistics (   self)
private

Definition at line 71 of file executionresult.py.

◆ visit()

def robot.result.executionresult.Result.visit (   self,
  visitor 
)

An entry point to visit the whole result object.

    :param visitor: An instance of :class:`~.visitor.ResultVisitor`.

    Visitors can gather information, modify results, etc. See
    :mod:`~robot.result` package for a simple usage example.

    Notice that it is also possible to call :meth:`result.suite.visit
    <robot.result.testsuite.TestSuite.visit>` if there is no need to
    visit the contained ``statistics`` or ``errors``.

Definition at line 123 of file executionresult.py.

Member Data Documentation

◆ _stat_config

robot.result.executionresult.Result._stat_config
private

Definition at line 44 of file executionresult.py.

◆ _status_rc

robot.result.executionresult.Result._status_rc
private

Definition at line 43 of file executionresult.py.

◆ errors

robot.result.executionresult.Result.errors

Definition at line 41 of file executionresult.py.

◆ generated_by_robot

robot.result.executionresult.Result.generated_by_robot

Definition at line 42 of file executionresult.py.

◆ rpa

robot.result.executionresult.Result.rpa

Definition at line 45 of file executionresult.py.

◆ source

robot.result.executionresult.Result.source

Definition at line 35 of file executionresult.py.

◆ suite

robot.result.executionresult.Result.suite

Definition at line 38 of file executionresult.py.

Property Documentation

◆ return_code

robot.result.executionresult.Result.return_code = property
static

Return code (integer) of test execution.

    By default returns the number of failed tests (max 250),
    but can be :func:`configured <configure>` to always return 0.

Definition at line 80 of file executionresult.py.

◆ statistics

robot.result.executionresult.Result.statistics = property
static

Test execution statistics.

    Statistics are an instance of
    :class:`~robot.model.statistics.Statistics` that is created based
    on the contained ``suite`` and possible
    :func:`configuration <configure>`.

    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)

Definition at line 69 of file executionresult.py.


The documentation for this class was generated from the following file: