尝试从我的测试脚本记录到机器人框架的日志.html中。我根本无法让它工作...
我已经阅读了文档...http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#logging-information
但日志中仍然没有任何内容.html除了测试报告。我错过了什么?
我尝试了以下方法:
print "output: " + "something"
logger.console("something")
logging.info("something")
sys.__stdout__.write('Got arg %sn' % "something")
print "something"
logger.info("output: " + "something")
测试运行如下:
*** Settings ***
Library Process
*** Test Cases ***
First test
${result} = Run Process python createCommunityTest/createCommunityTest.py
Should Be Equal As Integers ${result.rc} 0
你不会像这样在日志中得到进程的输出;Run Process
返回一个结果对象,它的属性之一是stdout
。 所以要查看它(在日志中(,添加这个
Log ${result.stdout}
还有一个用于stderr
输出的属性。