生成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. 关于DP

    关于DP 似乎摸到了门槛呢,学着学着Dijkstra突然有了感觉. 我们遍历的时候会遍历整张图的每个点每条边,然后与已知的对比大小,如果比现在方案好,就放入数组 那么,DP岂不是同样的思想? 在背包问 ...

  2. -L -Wl,-rpath-link -Wl,-rpath区别精讲

    目录 前言 源码准备 源码内容 尝试编译,保证源码没有问题 编译 首先编译world.c 编译并链接hello.c 调试编译test.c 结论 转载请注明出处,谢谢 https://www.cnblo ...

  3. vs code 修改文件的缩进

    百度这个问题的都是强迫症患者. 前人代码是2个空格缩进,我习惯3个, step1:打开  文件 —>  首选项 —> 设置,进入用户设置 step2:设置缩进量,(加两句代码) step3 ...

  4. 一个数据仓库时代开始--Hive

    一.什么是 Apache Hive? Apache Hive 是一个基于 Hadoop Haused 构建的开源数据仓库系统,我们使用它来查询和分析存储在 Hadoop 文件中的大型数据集.此外,通过 ...

  5. Linux学习-计算机基础

    Linux 学习-计算机基础 一.描述计算机的组成及其功能. 计算机系统是由硬件(Hardware)和软件(Software )两部分组成. 硬件: 从硬件基本结构上来讲,计算机是由运算器.控制器.存 ...

  6. python3配置文件的增删改查,记录一下

    #!/usr/bin/env python3 import json #json模块,用于将像字典的字符串转换为字典 import re #re模块,查找替换 import shutil #copy文 ...

  7. mysql 日志log

    my.ini log-error=D:/phpStudy/PHPTutorial/MySQL/log/error.loglog=D:/phpStudy/PHPTutorial/MySQL/log/my ...

  8. 《阿里巴巴Java开发手册》代码格式部分应用——idea中checkstyle的使用教程

    <阿里巴巴Java开发手册>代码格式部分应用--idea中checkstyle的使用教程 1.<阿里巴巴Java开发手册> 这是阿里巴巴工程师送给各位软件工程师的宝典,就像开车 ...

  9. 20155204 《Java程序设计》实验一(Java开发环境的熟悉)实验报告

    实验一 Java开发环境的熟悉 一.实验内容及步骤 1.使用JDK编译.运行简单的java程序 步骤一:在linux界面下运行终端 步骤二:在终端中打开待编译文件的文件夹 步骤三:使用 javac 文 ...

  10. 20155232 2016-2017-3 《Java程序设计》第4周学习总结

    20155232 2016-2017-3 <Java程序设计>第4周学习总结 教材学习内容总结 第六章 继承与多态 所谓继承就是避免多个类间重复定义共同行为. 1.重复在程序设计上就是不好 ...