REG:How can i print the output of Run process keyword while execution itself

581 views
Skip to first unread message

supriya s

unread,
Jan 7, 2021, 2:30:24 AM1/7/21
to robotframework-users
I want to print the output of Run Process keyword
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ${output}=    Run Process    D:\\Alert\\stack.bat    alias=myproc    stdout=True    stderr=D:\\Alert\\error.txt
    ${stdout} =    Get Process Result    myproc    stdout=true
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
By using "Get Process Result" it is printing the output after completing the process.But i want to print the output of steps while execution itself.
Could you please help me to print while executing the process

Dave Amies

unread,
Jan 14, 2021, 4:38:23 PM1/14/21
to robotframework-users

Hi Supriya,

I'm not sure what you are trying to achieve, but you cannot get a processes return code until that process has exited, this would be an expected result, see this test case, the "Getting results of unfinished processes is not supported" is expected to fail when calling Get Process Result on itself


Perhaps what you are after is one of the Automatic Variables like ${SUITE STATUS} or ${TEST STATUS}:

Note though that those variables are only available in teardown, so you would need to create a keyword to do the steps you are wanting and call it via a generic Test Teardown in *** Settings ****  or [Teardown] in your test.


Hope that helps,

Dave.

supriya s

unread,
Jan 25, 2021, 9:26:26 AM1/25/21
to robotframework-users
Hi Dave,
``````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````
${output}=    Run Process    D:\\Alert\\stack.bat    alias=myproc    stdout=True    stderr=D:\\Alert\\error.txt
${stdout} =    Get Process Result    myproc    stdout=true
``````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````
In code executing batch file by using "Run Process" keyword is flashing the code.This consumes 4 min time.Usually while flashing the code it prints sequence of steps.
Here by using "Get Process result" it is printing the output in console window ,once after finishing the execution of batch file completely.
But i want the output to print parallelly at the time of execution.Is there any keyword that supports printing output in console window at parallel time execution.

shivarajkumar poojar

unread,
Jan 28, 2021, 7:38:22 AM1/28/21
to robotframework-users
I ran something like this and it recorded command window output under stdout.txt:
Start Process     run.bat   shell=True  stdout=..//results//stdout.txt

shivarajkumar poojar

unread,
Jan 28, 2021, 7:38:22 AM1/28/21
to robotframework-users
Start Process     cmd.bat   shell=True  stdout=..//results//stdout.txt

On Monday, 25 January 2021 at 19:56:26 UTC+5:30 supriyal...@gmail.com wrote:
Reply all
Reply to author
Forward
0 new messages