Robot Framework API documentation
This documentation describes the public API of Robot Framework. Installation, basic usage and wealth of other topics are covered by the Robot Framework User Guide.
If you have questions related to the APIs, you can ask them on Robot Framework Slack, Forum or mailing list. If you encounter bugs, please submit an issue.
Entry points
Command line entry points are implemented as Python modules and they also provide programmatic APIs. Following entry points exist:
robot.run
entry point for executing tests.
robot.rebot
entry point for post-processing outputs (Rebot).
robot.libdoc
entry point for Libdoc tool.
robot.testdoc
entry point for Testdoc tool.
See built-in tool documentation for more details about Rebot, Libdoc, and Testdoc tools.
Public API
robot.api
package exposes the public APIs of Robot Framework.
Unless stated otherwise, the APIs exposed in this package are considered stable, and thus safe to use when building external tools on top of Robot Framework. Notice that all parsing APIs were rewritten in Robot Framework 3.2.
Currently exposed APIs are:
logger
module for libraries’ logging purposes.deco
module with decorators libraries can utilize.exceptions
module containing exceptions that libraries can utilize for reporting failures and other events. These exceptions can be imported also directly viarobot.api
likefrom robot.api import SkipExecution
.interfaces
module containing optional base classes that can be used when creating libraries and other extensions. New in Robot Framework 6.1.parsing
module exposing the parsing APIs. This module is new in Robot Framework 4.0. Various parsing related functions and classes were exposed directly viarobot.api
already in Robot Framework 3.2, but they are effectively deprecated and will be removed in the future.TestSuite
class for creating executable test suites programmatically andTestSuiteBuilder
class for creating such suites based on existing test data on the file system.SuiteVisitor
abstract class for processing testdata before execution. This can be used as a base for implementing a pre-run modifier that is taken into use with--prerunmodifier
commandline option.ExecutionResult()
factory method for reading execution results from XML output files andResultVisitor
abstract class to ease further processing the results.ResultVisitor
can also be used as a base for pre-Rebot modifier that is taken into use with--prerebotmodifier
commandline option.ResultWriter
class for writing reports, logs, XML outputs, and XUnit files. Can write results based on XML outputs on the file system, as well as based on the result objects returned by theExecutionResult()
or an executedTestSuite
.TypeInfo
class for parsing type hints and converting values based on them. New in Robot Framework 7.0.Languages
andLanguage
classes for external tools that need to work with different translations. The latter is also the base class to use with custom translations.
All of the above classes can be imported like:
from robot.api import ClassName
See documentations of the individual APIs for more details.
Tip
APIs related to the command line entry points are exposed directly
via the robot
root package.
All packages
All robot
packages are listed below. Typically you should not
need to import anything from them directly, but the above public APIs may
return objects implemented in them.