how to execute bat file (.bat) by use command robot framework?

ⅰ亾dé卋堺 提交于 2021-02-08 05:56:07

问题


I have one

script.bat

and i want to excute this script it in robotframework .

I'm also try with this but nothing work for me .

Run     ${CURDIR}/script/script.bat

Anyone could help me please ?


回答1:


Use Process Library to run bat file

Then your snippet wil be like

*** Settings ***
Library    Process

*** Test Case ***
Launch Bat File
    Run Process       ${CURDIR}/script/script.bat

I tested above snippet using sample bat file(script.bat) which launch chrome.

start chrome https://www.google.co.in/

Even i tried with OperatingSystem library and it's working fine. Following is the snippet.

*** Settings ***
Library    OperatingSystem

*** Test Case ***
Lauch Bat File
    Run       ${CURDIR}/script/script.bat


来源:https://stackoverflow.com/questions/50924613/how-to-execute-bat-file-bat-by-use-command-robot-framework

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