gpt4 book ai didi

Python无法登录Robot框架log.html

转载 作者:行者123 更新时间:2023-11-30 22:31:12 25 4
gpt4 key购买 nike

尝试从我的测试脚本登录到机器人框架的 log.html 中。我根本无法让它发挥作用......

我已阅读文档... http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#logging-information

但是除了测试报告之外,log.html 中仍然没有任何内容。我缺少什么?

我尝试过以下方法:

print "output: " + "something"
logger.console("something")
logging.info("something")
sys.__stdout__.write('Got arg %s\n' % "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

最佳答案

您不会像这样在日志中获得进程的输出; 运行进程返回 result object ,其属性之一是 stdout。因此,要查看它(在日志中),请添加此

Log     ${result.stdout}

还有一个用于 stderr 输出的属性。

关于Python无法登录Robot框架log.html,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45877716/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com