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.
Main API entry points are documented here, but the lower level
implementation details are not always that well documented. If the
documentation is insufficient, it is possible to view the source code
by clicking [source] link in the documentation. In case viewing the
source is not helpful either, questions may be sent to the
robotframework-users mailing list.
Entry points¶
Command line entry points are implemented as Python modules and they also provide programmatic APIs. Following entry points exist:
robot.runentry point for executing tests.robot.rebotentry point for post-processing outputs (Rebot).robot.libdocentry point for Libdoc tool.robot.testdocentry point for Testdoc tool.robot.tidyentry point for Tidy tool.
See built-in tool documentation for more details about Rebot, Libdoc, Testdoc, and Tidy tools.
Java entry points¶
The Robot Framework Jar distribution contains also a Java API, in the form of the org.robotframework.RobotFramework class.
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.
Currently exposed APIs are:
loggermodule for test libraries’ logging purposes.decomodule with decorators test libraries can utilize.TestCaseFile,TestDataDirectory, andResourceFileclasses for parsing test data files and directories. In addition, a convenience factory methodTestData()creates eitherTestCaseFileorTestDataDirectoryobjects based on the input.TestSuiteclass for creating executable test suites programmatically andTestSuiteBuilderclass for creating such suites based on existing test data on the file system.SuiteVisitorabstract 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--prerunmodifiercommandline option.ExecutionResult()factory method for reading execution results from XML output files andResultVisitorabstract class to ease further processing the results.ResultVisitorcan also be used as a base for pre-Rebot modifier that is taken into use with--prerebotmodifiercommandline option.ResultWriterclass 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.
All of the above names can be imported like:
from robot.api import ApiName
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.
- robot package
- robot.api package
- robot.conf package
- robot.htmldata package
- robot.libdocpkg package
- robot.libraries package
- robot.model package
- robot.output package
- robot.parsing package
- robot.reporting package
- robot.result package
- robot.running package
- robot.utils package
- robot.variables package
- robot.writer package