how to run commands in CMD prompt using robot framework

早过忘川 提交于 2019-12-13 09:41:36

问题


How do i run the command 'ipconfig' in cmd prompt using robot framework. running below code gives me the complete result. I just need IPV4 Address.

${frt}= | Run | ipconfig
Log ${frt}  

回答1:


Although it would propably be more effective of use a custom Python library, it is possible to accomplish with regular Robot Framework:

*** Settings ***
Library    OperatingSystem
Library    String

*** Test Cases ***
Test IPConfig
    ${frt}=     Run     ipconfig | find "IPv4"
    ${IP}=    Fetch From Right    ${frt}    ${SPACE}
    Log To Console     [${IP}]


来源:https://stackoverflow.com/questions/42851850/how-to-run-commands-in-cmd-prompt-using-robot-framework

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