Can we Run the robot keywords from python file

Hi All

I have written some of the robot keywords in robot file
Is there any way that I can run the keywords from the python file and get the returning value in python file


You can call the various Run Keyword * keywords from BuiltIn in Python, some of which return values.

I have not tried:

from robot.libraries.BuiltIn    import BuiltIn
val = BuiltIn().run_keyword("keyword", locator)

directly, but it might do what you need.

1 Like

Hi Burr,

Thanks for the replay

i have tried this but its giving error “robot.libraries.BuiltIn.RobotNotRunningError: Cannot access execution context”


It only works when Robot Framework execution is ongoing in the same Python processes.

1 Like