使用robot跑页面自动化用例的时候,经常受到网络因素的影响而失败,这样跑一边的用例当然不是我们最终预想的,因此我们需要将失败的用例重跑,并生成报告。
网上多是修改代码来实现自动重跑,其实pybot和rebot中已经有自带重跑失败用例与合成报告的方法了。
在命令行下,直接pybot是最方便的,因此第一次用例:
call Pybot.bat -outputdir C:\WebTest\webReport\R1 C:\WebTest\web
命令pybot -help 可以查到有一个方法:
-R --rerunfailed output Select failed tests from an earlier output file to be
re-executed. Equivalent to selecting same tests
individually using --test option.
这个失败重跑输出文件路径的(英语渣)
那么重跑第一次失败的用例:
call Pybot.bat -R C:\WebTest\webReport\R1\output.xml --outputdir C:\WebTest\webReport\R2 C:\WebTest\web
重跑C:\WebTest\we