Mahesh
Mahesh

Reputation: 33

How to put debug/Breakpoint in Robot framework test in Pycharm?

My .py files in Robot-Framework allows me to introduce breakpoints but .robot file it doesn't allow. How do i introduce and toggle breakpoints in my .robot test files for debugging?

Upvotes: 1

Views: 5427

Answers (2)

oferdan
oferdan

Reputation: 15

It is possible to add breakpoints to both .py and .robot files with Robot Framework Language Server. There are plugins for both PyCharm and VS Code.

Upvotes: 1

Todor Minakov
Todor Minakov

Reputation: 20067

Nohow - you can't add a Pycharm breakpoint in a .robot file.

The reason is your test script is not a real python code. When a run is started, Pycharm runs the entry point of the robot module - which reads the file's text, parses it in its internal structures and "converts" to python code (in quotes, as it really doesn't convert anything, makes RF objects and constructs a flow b/n them).

The actual python code that is ran is in the robotframework package (and any other py packages & modules it imports). For both the framework and Pycharm the .robot file is just a text file - thus no breakpoints are effective.

You can add a breakpoint inside a py file - one of the framework's, or in a library of yours, and it will be honored.
Or, you can use the Debug library - once it hits the point where you've put the Debug keyword, it gives you an interactive shell with full context at the current point (e.g. you can CRUD variables, or run available keywords).

Upvotes: 2

Related Questions