user3303266
user3303266

Reputation: 371

RobotFramework: Executing a unix command locally

I know that the below examples can be used on a remote machine. But how would i do same locally

Execute Command   rm -rf ${processed_path}
Execute Command   rm -rf ${failed_path}
Execute Command   rm -rf ${files_to_process_path}
Execute Command   mkdir ${processed_path}
Execute Command   mkdir ${failed_path}

Especially for getting back return codes etc?

Upvotes: 0

Views: 930

Answers (2)

Manjunath Raddi
Manjunath Raddi

Reputation: 421

Using the OperatingSystem library.

*** Test Cases ***
Execute Command In Localhost
    ${rc}                       ${output}=     Run And Return Rc And Output  rm -rf ${processed_path}
    Log                         ${rc}                console=${True}
    Should Be Equal As Integers ${rc}   0

Upvotes: 0

Helio
Helio

Reputation: 3712

Use the OperatingSystem library. For example the Run And Return RC keyword.

See the documentation here.

Upvotes: 2

Related Questions