TestNGReporter

上一篇 / 下一篇  2009-02-25 10:58:31 / 个人分类:Selenium

TestNG 默认的out put reporter样子实在是有点丑陋。本来想有功夫自己写一个好看一点的,因为TestNG是支持定制的reporter样子的。

O%^$}:j qcD-u)q0
不过最近发现一个叫ReportNG 的opensource 的项目就定制了一个testng 的reporter.支持html 和xml,虽然比较简单。但是样子比原来的好看了很多。
所以拿过来用了一下。感觉挺好的。决定引入。

iI6Z*{*e VH0

g2c~ Chkh*V9A0
先把需要的jar加进来。
如果项目是用ant 编译运行的话,可以参考
<testng classpathref="test-path"
              utputdir="${test-results.dir}"
              haltonfailure="true"
              useDefaultListeners="false"
              listeners="org.uncommons.reportng.HTMLReporter,org.uncommons.reportng.JUnitXMLReporter">
        <xmlfileset dir="." includes="testng.xml"/>
        <sysproperty key="org.uncommons.reportng.title" value="My Test Report"/>
      </testng>
如果项目直接在Eclipse 里运行的话, Run As -> Open Run Dialog 然后在窗口的Arguments 选项卡里面的 Program arguments 里面 加 -listener org.uncommons.reportng.HTMLReporter
这样运行完就自动产生一个html的reporter了。
51Testing软件测试网z*m
S*[/F7t;Th
51Testing软件测试网0l/st3b[7|X

TAG:

 

评分:0

我来说两句

Open Toolbar