【自动化测试】如何修改rf项目下的报告位置

  我们都知道robotframework测试报告是放置在temp临时文件下,这样我们维护起来也不太方便;如果在ride可视化界面使用命令,会发现如果路径带有中文,最后形成的位置是16进制下的路径。如图所示:

  

   于是,给大家一个小技巧,可以保存我们的测试报告到我们项目下的位置。修改python下 Libsite-packages obotidecontrib estrunner的 testrunner.py

    def _add_tmp_outputdir_if_not_given_by_user(self, command, standard_args):
        if "--outputdir" not in command and "-d" not in command:
            suiteurl = os.path.abspath(self._project.suite.source)
            repurl = os.path.join(suiteurl,"自动化测试报告")
            standard_args.extend(["--outputdir", repurl])

  这样我们可以在ride运行获取到的结果:

  

   

原文地址:https://www.cnblogs.com/mumushizhige/p/14043321.html