[英]How can python script call API define in robotremoteserver library?
my robotremoteserver library defines some API like startenv, stopenv我的机器人远程服务器库定义了一些 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:])
I tried a c.txt as robot file and was able to call API,我尝试了一个 c.txt 作为机器人文件并且能够调用 API,
** Settings ***
Library Remote http://serverxxxx:8720
*** Test Cases ***
startenv
${rc} = startenv
stopenv
${rc} = stopenv
but How can we call these from remote XMLRPC python client script?但是我们如何从远程 XMLRPC python 客户端脚本调用这些? tried things as below
尝试如下
from robot.libraries.Remote import Remote
s = Remote('http://serverxxxx:8270')
s.startenv()
s.run_keyword("startenv")
But none works :(但没有一个工作:(
It should be s.run_keyword("startenv",None,None).它应该是 s.run_keyword("startenv",None,None)。 run_keyword() takes 4 positional arguments
run_keyword() 需要 4 个位置参数
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.