RobotKernel is a Robot Framework IPython kernel for Jupyter Notebook and JupyterLab.
Requires Python 3.6 or later and Robot Framework 3.1 or later.
Check also ipythonrobotframework for alternative Robot Framework IPython kernel.
You can try RobotKernel without installing it at MyBinder cloud:
Jupyter Notebook: https://mybinder.org/v2/gh/robots-from-jupyter/robotkernel/master?urlpath=tree/example.ipynb
JupyterLab: https://mybinder.org/v2/gh/robots-from-jupyter/robotkernel/master?urlpath=lab/tree/example.ipynb
Note: Log | Report -links on existing notebooks are only active on trusted notebooks.
RobotKernel is included with RobotLab distribution, but there are also plenty of other installation options.
notebooks/01 Running Code.ipynb notebooks/02 Python XKCD.ipynb notebooks/03 Running Robot.ipynb notebooks/04 Robot XKCD.ipynb notebooks/05 Interactive Selenium.ipynb notebooks/07 Executable Keywords.ipynb notebooks/08 Interactive WhiteLibrary.ipynb
It is possible to export test suites directly from Jupyter Notebook or JupyterLab user interface (into traditional .robot
files), but also from command line:
$ jupyter nbconvert --to script example.ipynb
Robotkernel installs script named nbrobot
, which the Robot Frameworks test runner robot
with support for executing Jupyter notebooks created with Robotkernel:
$ nbrobot example.ipynb
In addition, it is also possible to execute notebooks as such, resulting into a new notebook with embedded execution logs and reports:
$ jupyter nbconvert --to notebook --execute example.ipynb
This will stop the execution at first failing test case.
When execution with errors, to also get a result notebook with execution logs saved, an extra flag --ExecutePreprocessor.allow_errors=True
must be set:
$ jupyter nbconvert --ExecutePreprocessor.allow_errors=True --to notebook --execute example.ipynb
This may change in future versions of nbconvert.
Note that when executing a notebook, each cell with tests cases or tasks will be executed as its own suite. It might be more efficient to export notebook into a robot script and execute that with the traditional robot runner.