Robot Frame work in Linux

女生的网名这么多〃 提交于 2019-12-10 10:48:44

问题


How to get the status of the command which is executed in linux with the help of robot frame work. For example If use this:

SSHLibrary open Connection (server)
SSHLibrary login  xxxxx  xxxxx
${1111}= Write ${command}
${2222}= Read  delay=5s

In the above script how to get the status of the command I have executed and stored in the ${1111} var,

Eg; If command executed pass the I have to get a status with 0 otherwise 1


回答1:


You need to use Execute command instead of Write

The SSHLibrary documentation gives this example:

${rc}=    Execute Command    echo Success guaranteed.    return_stdout=False    return_rc=True
Should Be Equal    ${rc}    ${0}


来源:https://stackoverflow.com/questions/45101647/robot-frame-work-in-linux

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!