Robot Framework - Jupyter Notebook

Hi All,

I have a question about the use of Jupyter Notebook in conjunction with Robot Framework. I am new to the RF community but I have extensive experience with Behave Framework. With this framework I developed my testcases in a Jupyter Notebook to ensure that my code is working step by step, directly within the open browser and later implement it into the .py files. I could run any cell with a piece of code, I was able to write complex structures and check if my code to automate the steps are working as supposed. However, it seems this way of working is not available in RF?

I have looked into the robotframework-jupyterlibrary and robotkernel, but I don’t get it to work. I am able to select the kernel in VSCode, but nothing happens and I get an importerror (see below) . I even tried it on the Jupyter Notebook on localhost and the same is happening (can select the kernel, but that’s it). I even have had the issue that some dependencies were not available to start the kernel, but by reinstalling the packages, this seems to be fixed.

Failed to start the Kernel. 
ImportError: cannot import name 'display' from 'IPython.core.display'

So, I have two questions on this matter:

  • Is it possible to make use of Jupyter Notebooks while coding the test steps? If so, how could I get it to work? I already updated every package via PIP.
  • If not: what is the best practice to check if your code is running well, besides of running the full test script over and over again?

If there is no possibility of working with Jupyter… I would be so enlightend if this could be developed in the future without a hassle to get it to work!

If there are any questions, feel free to ask!

Kind regards,

Hilbert

So the code has been deprecated and what ever piece of software you are using is depending on older IPython or you are using old version that has not been updated to use the new version.

Easiest way for you is probably to downgrade ?

Thank you for the information.
When I try to downgrade to ipython version 7.13, another errors occur. If I get a to old package of ipython then other packages will fail because they are incompatible.

Failed to start the Kernel.
ImportError: cannot import name ‘ErrorReporter’ from ‘robot.running.builder.parsers’

Therefore the package should be updated to the newest version?

I know that the VS Code extension robotcode also supports some implementation of notebooks that might be what you are looking for.

The documentation I found through a slack message was some documentation: Configuration | RobotCode and a video with detailed instructions: https://www.youtube.com/watch?v=7Uad_250YuI&t

After a little more checking of the links I see that the links are mostly about robot.toml that was mentioned inthe robotbook thread in slack.
What I remember trying out myself is that you can create simple keyword calls and run them from a xxx.robotbook file if you have the vscode robotcode extension. That will then show you more details and options of what you can do. As I remember only simple scripts can be done, not imports.

Good luck!

I tried it out to see what was available. And as you can see in the image it supports:

  • Markdown for comments
  • Keyword calls directly (no imports or sections, as far as I’m aware)
  • Log of the keywords you execute

Thank you for the information. The way you described is working, however I want to open my browser and test my code immediatly with the open browser. Think of clicking the right button, test for/while loops and see what Selenium is doing.

For now I guess that is not possible (yet) as I found this message:

  • Jupyter Notebook-Like Experience: Enjoy the flexibility of a Jupyter Notebook-like environment for working with Robot Framework code, allowing you to explore, test, and iterate quickly and efficiently. (direct integration with Jupyter Notebooks is planned for a future release.)

I hope they will implement this soon as that makes debugging much easier!