创建RF测试库装饰器@keyword py文件中: from robot.api.deco import keyword @keyword('readtxt') def readtxtFile(key, filepath): print "此方法读取txt中内容"