简体   繁体   中英

How can python script call API define in robotremoteserver library?

my robotremoteserver library defines some API like 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,

** 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? 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). run_keyword() takes 4 positional arguments

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM