Debugging robot framework python keyword libraries

As I prefer to use ipdb more than pdb, then here is my way to use it with robot

import ipdb; ipdb.stdout.update_stdout(); ipdb.stdout.set_trace()

Hint: For some reason the autocomplete wont be working using pdb nor ipdb so if u care about the autocomplete u need to install pdbpp via pip install pdbpp then add this to your code

import sys
import pdb
for attr in ('stdin', 'stdout', 'stderr'):
    setattr(sys, attr, getattr(sys, '__%s__' % attr))
pdb.set_trace()

You can use pdb with robot. How to do so is documented in the robot framework user guide, in the section titled Using the python debugger (pdb).

The example it gives is to add this where you want to set a breakpoint:

import sys, pdb; pdb.Pdb(stdout=sys.__stdout__).set_trace()