Sidara KEO
Sidara KEO

Reputation: 1709

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

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 ?

Upvotes: 3

Views: 10141

Answers (1)

user6470139
user6470139

Reputation:

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

Upvotes: 2

Related Questions