首页 > 解决方案 > 如何在 log.html、report.html、output.xml 等机器人框架中保存日志,其中包含 ex log.html-> logxyz.html、abcreport.html 的特定名称?

问题描述

我正在尝试将具有特定名称的日志保存在机器人框架中,但无法做到这一点。我们有办法用我们想要的名称保存日志名称吗?如果是,那么该怎么做?

标签: robotframework

解决方案


您可以使用以下选项来配置输出文件:

-d, --outputdir <dir> Defines where to create output files.
-o, --output <file>   Sets the path to the generated output file.
-l, --log <file       Sets the path to the generated log file.
-r, --report <file>   Sets the path to the generated report file.

因此,要更改日志文件的名称,请像这样启动您的测试:

robot --log logxyz --report abcreport my_robot.robot

您可以查看 Robot Framework User Guide 中的所有命令行选项以了解更多信息。

使用-T--timestampoutputs您也可以在输出文件的名称中添加时间戳。一个带有:--log的示例名称。--timestampoutputsmy_log_file_name-20190103-102712.html


推荐阅读