生成reportng报告操作步骤:

一、maven的pom.xml文件需要添加内容:

<properties>

        <!-- maven 参数配置,这里引用不同的testng.xml -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<xmlFileName>testng.xml</xmlFileName>
</properties>
<!-- https://mvnrepository.com/artifact/org.testng/testng -->
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.9.10</version>
<!-- <scope>compile</scope> -->
<scope>test</scope>
</dependency>
<!-- 依赖reportNg 关联testNg-->
<dependency>
<groupId>org.uncommons</groupId>
<artifactId>reportng</artifactId>
<version>1.1.4</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- 依赖Guice -->
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>3.0</version>
<scope>test</scope>
</dependency>
<!--  build -->
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.18.1</version>
<configuration>
<systemPropertyVariables>
<org.uncommons.reportng.escape-output>false</org.uncommons.reportng.escape-output>
</systemPropertyVariables>
<properties>
<property>
<name>usedefaultlisteners</name>
<value>false</value>
</property>
</properties>
<suiteXmlFiles>
<suiteXmlFile>res/${xmlFileName}</suiteXmlFile>
<!--表示使用xmlFileName作为testNG的配置文件 -->
</suiteXmlFiles>
<testFailureIgnore>true</testFailureIgnore>
<!--当case错误的时候继续运行,否则当case错误的时候报build错误 -->
</configuration>
</plugin>
<!-- 添加插件,添加ReportNg的监听器,修改最后的TestNg的报告 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.5</version>
<configuration>
<properties>
<property>
<name>usedefaultlisteners</name>
<value>false</value>
</property>
<property>
<name>listener</name>
<value>org.uncommons.reportng.HTMLReporter, org.uncommons.reportng.JUnitXMLReporter</value>
</property>
</properties>
<workingDirectory>target/</workingDirectory>
<forkMode>always</forkMode>
</configuration>
</plugin>
</plugins>
</build>

备注:以上内容添加完成后运行Maven  install确保依赖包加载到工程的Maven Dependencies里边;

二、testng的testng.xml文件需要添加内容:

    <listeners>
<listener class-name="org.uncommons.reportng.HTMLReporter" />
<listener class-name="org.uncommons.reportng.JUnitXMLReporter" />
</listeners>

三、选中pom.xml执行Maven test后测试报告艘在位置及最终效果如下:

1)位置

2)效果

testng系列-ReportNG的更多相关文章

  1. Idea+maven+testNG+Selenium+ReportNG自动化框架搭建

    1.Idea创建一个空的Maven项目 创建后默认项目目录如图所示 2.配置pom.xml文件 <?xml version="1.0" encoding="UTF- ...

  2. 自动化测试:java + testng + maven + reportng + jenkins + selenium (一)_基于win环境

    集成环境:jdk1.7 + tomcat1.7+ eclipse mars + maven + testng6.14.2 + selenium-java2.40.0 + reportng1.1.4 + ...

  3. 我的自动化测试历程(Selenium+TestNG+Java+ReportNG+Jenkins)

    原地址:http://blog.csdn.net/shilinjie_8952/article/details/53380373?locationNum=11&fps=1 测试环境:Java+ ...

  4. IDEA+MAVEN+testNG(reportNG)

    转载:http://www.cnblogs.com/aikachin/p/7765846.html 参考: http://blog.csdn.net/langsand/article/details/ ...

  5. Selenium 我的自动化测试历程 (Selenium+TestNG+Java+ReportNG+Jenkins)

    测试环境:Java+Selenium+TestNG,Jenkins持续集成. 测试代码 代码结构 采用页面对象模型(Page Object),减少UI修改后,对代码的影响.   Java编写,采用Te ...

  6. TestNG系列(五)TestNG测试报告

    以TestNG执行测试方法后会生成test-output测试结果集,其中index.html是测试结果的展示.TestNG的测试报告可以通过IReporter监听自定义,也可以通过第三方工具(Repo ...

  7. TestNG系列之四: TestNg依赖 dependsOnMethods

    有时候,你可能需要在一个特定的顺序调用方法 执行原则: 1.被依赖的先执行: 2. 再执行没配置依赖的, 3.再执行需要依赖的: 4.若无依赖关系,依次执行) 一个方法有多个依赖时用空格隔开 有两种依 ...

  8. TestNG系列之二:TestNG套件测试

    测试套件的测试是为了测试软件程序的行为或一系列行为的情况下,是一个集合.在TestNG,我们不能定义一套测试源代码,但它代表的套件是一个XML文件执行特征.这也允许灵活的配置要运行的测试.套件可以包含 ...

  9. TestNG系列之:TestNG基本注解(注释)

    注解 描述 @BeforeSuite 注解的方法只运行一次,在当前suite所有测试执行之前执行 @AfterSuite 注解的方法只运行一次,在当前suite所有测试执行之后执行 @BeforeCl ...

随机推荐

  1. [Oracle]Oracle良性SQL建议

    (1)选择最有效率的表名顺序(只在基于规则的优化器中有效): Oracle的解析器按照从右到左的顺序处理FROM子句中的表名,FROM子句中写在最后的表(基础表 driving table)将被最先处 ...

  2. Xcode 控制台打印Unicode字符串转换为中文

    在Xcode的控制台里直接打印一个数组或者字典,输出的都是一些Unicode的编码,不方便调试.    要想看到中文,则要去获取对应的key或者数组下标.得到具体某一个对象才能看到中文,给我们调试起来 ...

  3. VB

    on error resume next: 从该语句开始,遇到错误时程序不会中止,也不会出现错误提示,将继续运行.作用范围直至程序结束或语句所在函数等结束 Public Property :可读也可写 ...

  4. 在express中HMR(合并express和webpack-dev-server)

    在学习react的时候,经常用create-react-app来创建web应用,然而写到后面总有连自己服务器和数据库的需求,create-react-app创建的是一个webpack-dev-serv ...

  5. Windows常用shell命令

    一.Windows的Shell命令又是Windows的CMD命令.而cmd命令又是原来MS-DOS系统保留下来 二.Windows Shell命令是基于配置好的Path环境变量,对Shell命令在Pa ...

  6. 1、win10下的Docker+Redis 的下载及简单使用

    一.下载Docker: 因为始终注册docker账号不成功,所以在这里点击下载. 选中docker-for-windows/ 选中beta/ 下载这个.msi文件 二.安装 1.安装.msi文件,桌面 ...

  7. Delphi在Android下通过WiFI进行调试

    如果我们需要调试USB程序且Android设备只有一个USB口,那么可以通过WiFi来调试程序,这样USB口就可以用了. 大致步骤如下: 1.在有root权限的Android设备里安装“Wifi AD ...

  8. Flume(2)-拓扑结构与Agent内部原理

    一. 拓扑结构 1. 串行模式 这种模式是将多个flume给顺序连接起来了,从最初的source开始到最终sink传送的目的存储系统.此模式不建议桥接过多的flume数量, flume数量过多不仅会影 ...

  9. spark执行命令 监控执行命令

    #!/bin/bash #/usr/hdp/current/flume-server/bin/flume-ng agent -c conf/ -f /usr/hdp/current/flume-ser ...

  10. 阻止Quartus优化掉信号

    使用SignalTap II Logic Analyzer观察信号,有时要观察的信号会被Quartus优化掉,这种情况下可以给信号指定属性.以下例子均使用Verilog. 1. 如果是组合逻辑信号,可 ...