Robot Framework: starting a process with arguments on Windows?
I am completely new with Robot Framework and I cannot find a way to start a process with arguments on Windows. I'm pretty sure I didn't understand the documentation, and there is an easy way to do this, though ...
Ok, let's say I can run my program using the following command:
c:\myappdir>MyApp.exe /I ..\params\myAppParams.bin
How can this be done in the Russian Federation?
Any help would be greatly appreciated. Many thanks:)
Edit 1:
Here is a snippet of my code:
| *Setting* | *Value*
| Resource | compilationResource.robot
#(Process lib is included in compilationResource)
#I removed the "|" for readability
...
TEST1
...
${REPLAYEXEDIR}= get_replay_exe_dir #from a custom lib included in compilationResource
${EXEFULLPATH}= Join Path ${WORKSPACEDIR} ${REPLAYEXEDIR} SDataProc.exe
Should Exist ${EXEFULLPATH}
${REPLAYLOGPATH}= Join Path ${WORKSPACEDIR} ReplayLog.log
${REPLAYFILEPATH}= Join Path ${WORKSPACEDIR} params params.bin
Should Exist ${REPLAYFILEPATH}
Start Process ${EXEFULLPATH} stderr=${REPLAYLOGPATH} stdout=${REPLAYLOGPATH} alias=replayjob
Process Should Be Running replayjob
Terminate Process replayjob
Process Should Be Stopped replayjob
It works. Once I try to include arguments like this:
Start Process ${EXEFULLPATH} ${/}I ${REPLAYFILEPATH} stderr=${REPLAYLOGPATH} stdout=${REPLAYLOGPATH} alias=replayjob
I am getting this error:
WindowsError: [Error 2] The system cannot find the file specified
and this error comes from the startup process line.
Let me know if I am unclear or if you need more information. Thanks everyone for your help with this.
Edit 2: SOLUTION
Each argument must be separated from the other (unless working in a shell) with double space. I didn't use double spaces, so the error is.
| | Start Process | ${EXEFULLPATH} | /I | ${REPLAYFILEPATH} | stderr=${REPLAYLOGPATH} | stdout=${REPLAYLOGPATH} | alias=replayjob
source to share
To run your program from a Robot Framework test, use the Process Library , for example:
*** Settings ***
Library Process
*** Test Cases ***
First test
Run Process c:${/}myappdir${/}prog.py /I ..\params\myAppParams.bin
# and then do some tests....
source to share