1
votes

Trying to log from my test script into the log.html of robot framework. I simply cannot make it work...

I have read the docs ... http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#logging-information

But still nothing inside the log.html besides the test reports. What am I missing?

I have tried the following:

print "output: " + "something"
logger.console("something")
logging.info("something")
sys.__stdout__.write('Got arg %s\n' % "something")
print "something"
logger.info("output: " + "something")

The test is run like this:

*** Settings ***
Library   Process


*** Test Cases ***
First test
    ${result} =     Run Process     python    createCommunityTest/createCommunityTest.py
    Should Be Equal As Integers     ${result.rc}    0
1
Is createCommunityTest supposed to be a library with robot keywords, or is it a script?Bryan Oakley
It's a python script.Jacob
When you run a Python script as a shell Process that makes RF captures all outputs. But if you call your Python script as an RF Library then you have more control.MarkHu

1 Answers

3
votes

You won't get the process'es output in the log just like that; the Run Process returns a result object, and one of its attributes is stdout. So to see it (in the logs), add this

Log     ${result.stdout}

There's also an attribute for the stderr output.