Reputation: 511
Python: 3.7.3 Robot: 3.1.1
Robot framework is unable to read user defined python method.
loo.robot
*** Settings ***
Library ../voo/boo/foo.py
fookeyword
[Arguments] ${arg1} ${arg2} ${arg3}
${body}= body ${arg1} ${arg2} ${arg3}
[Return] ${body}
foo.py
class foo():
def body(self,arg1,arg2,arg3):
some operation
File location: Robot: Basefolder/roo/ioo.robot Python: Basefolder/voo/boo/foo.py
Note: All the above paths are being added in system environment variable, Pycharm interpreter and python path. Also, pycharm is able to navigate to respective python file and method while clicking but for some unknown reason, system still throwing 'No keyword with name 'body' found' error.
Can someone suggest what would be the cause of the above error?
Upvotes: 1
Views: 4517
Reputation: 96
This happened to me as well. The correct error message is not getting displayed, whenever a python function is called in robot framework. The error should be in the python file. What you have to do is: Make sure the python file is error free then try executing the robot script
Upvotes: 3