使用Selenium + Python + Jenkins捕获失败的屏幕截图

时间:2015-12-08 07:50:31

标签: python selenium jenkins screenshot jenkins-plugins

我用Selenium Python编写了我的脚本。在Jenkins中,我添加了Publish JUnit测试结果报告(http://nose.readthedocs.org/en/latest/plugins/xunit.html)。但是,我想在该报告中添加屏幕截图。我觉得如果没有截图,我的测试就无用了。我怎样才能做到这一点?我也希望在我的电子邮件中收到错误的截图作为附件。

我可以通过使用Jenkins插件实现这一目标吗?或者我需要在我的selenium脚本中添加一些东西?我无法在selenium python中找到任何有用的东西。

我回答了以下问题,但确实解释了整个过程 Adding a png image and table html while sending email in Jenkins

请帮助.....

1 个答案:

答案 0 :(得分:1)

我看到有一篇关于Selenium Java + Jenkins的文章不是关于python

https://www.safaribooksonline.com/blog/2014/06/19/jenkins-pictures-stuff/