我试图使用API来构建和运行测试套件,我注意到使用API和shell时输出的log.html有细微的不同
使用命令行调用时的日志
通过最小python脚本运行时的日志
最小python脚本:
import robot.api
import robot.result
from robot.conf.settings import RobotSettings
options = {
"output": "./results.xml",
"log": "./log.html",
"report": "./report.html",
"loglevel": "TRACE"
}
settings = RobotSettings(options)
suite = robot.api.TestSuiteBuilder().build(".")
result = suite.run(settings=settings)
result_writer = robot.api.ResultWriter(result)
result_writer.write_results(settings=settings.get_rebot_settings())
正如可以看到的日志丢失了很多关键字细节,我如何才能找回这些
编辑:更改为正确方法后的最小文件:
import robot.api
import robot.result
from robot.conf.settings import RobotSettings
options = {
"output": "./results.xml",
"log": "./log.html",
"report": "./report.html",
"loglevel": "TRACE",
"rpa": False
}
settings = RobotSettings(options)
suite = robot.api.TestSuiteBuilder().build(".")
result = suite.run(settings=settings)
result_writer = robot.api.ResultWriter("./results.xml")
result_writer.write_results(settings=settings.get_rebot_settings())
您确定您的系统上没有两个不同的
Robot Framework
程序包处于活动状态吗?一个在路径外部,另一个作为包在venv
中。 试一试并检查
cmd
行中的版本是否与运行脚本的版本相同。 您还应该尝试升级到最新版本,这通常可以解决此类错误我还发现了一个类似的错误on this thread,它表示
相关问题 更多 >
编程相关推荐