我的robotremoteserver库定义了一些API,例如startenv,stopenv
from robotremoteserver import RobotRemoteServer
class myLibrary(object):
def startenv(self):
return "start"
def stopenv(self):
return "stop"
if __name__ == '__main__':
RobotRemoteServer(myLibrary(), *sys.argv[1:])
我尝试将c.txt用作机械手文件并能够调用API,
** Settings ***
Library Remote http://serverxxxx:8720
*** Test Cases ***
startenv
${rc} = startenv
stopenv
${rc} = stopenv
但是我们如何从远程XMLRPC python客户端脚本中调用它们?尝试了以下内容
from robot.libraries.Remote import Remote
s = Remote('http://serverxxxx:8270')
s.startenv()
s.run_keyword("startenv")
但是没有效果:(
应该是s.run_keyword(“ startenv”,None,None)。run_keyword()接受4个位置参数