生成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. 精准测试白皮书v3.0-2019最新版

    现代社会是建立在各种以计算机为基石的软件技术基础之上的.随着日新月异的需求变化,软件系统越来越复杂.很多人觉得软件开发才是重要环节,但实际上,无法对大型软件进行有效的质量把控,就无法真正构建与维护大型 ...

  2. iOS 根据url生成二维码贴到底图上

    根据url 生成指定尺寸的二维码图片 UIImage * createBinaryCodeImg(const char * url ,CGFloat size) { //create binary c ...

  3. 数字转汉字|语言代码|NSNumberFormatter

    iOS之阿拉伯数字转中文数字 - 简书 iOS中金额数字的格式化 NSNumberFormatter - 简书 ISO语言代码(ISO-639)与国家代码(ISO-3166) - CSDN博客 语种名 ...

  4. 从对集合数据去重到Distinct源码分析

    今天在写代码的时候要对数据进行去重,正打算使用Distinct方法的时候,发现这个用了这么久的东西,竟然不知道它是怎么实现的,于是就有了这篇文章. 使用的.net core2.0 1.需求 假如我们有 ...

  5. 每天一个linux命令(1):find命令之exec

    ind是我们很常用的一个Linux命令,但是我们一般查找出来的并不仅仅是看看而已,还会有进一步的操作,这个时候exec的作用就显现出来了. exec解释:-exec 参数后面跟的是command命令, ...

  6. $.ajax 完整参数

    jquery中的ajax方法参数 url: 要求为String类型的参数,(默认为当前页地址)发送请求的地址. type: 要求为String类型的参数,请求方式(post或get)默认为get.注意 ...

  7. 二·、spring成长之路——委派设计模式和单例设计模式

    3.委派设计模式 设计思想:就是多个类去完成一项的工作,其中一个类去分发任务,其他类做具体的任务,而具体表现是这个委派类的工作,具体过程是被委派类来操作的 [ITask.java]定义工作的统一标准 ...

  8. 搭建php服务器网站

    一.Apache安装 yum install httpd启动systemctl start httpd.service #启动systemctl stop httpd.service #停止syste ...

  9. echo、print、print_r、var_dump

    echo(): 可以一次输出多个值,多个值之间用逗号分隔.echo是语言结构(language construct),而并不是真正的函数,因此不能作为表达式的一部分使用. print(): 函数pri ...

  10. 第一篇 C/C++基本语言类型

    总概: { C:面向过程,以过程为中心,以算法为驱动 } { C++:面向对象,以过对象中心,以消息为驱动 个人理解:一切皆对象的思想 } 一 前言总概 1.常量变量 初始化对象与赋值是两个概念 直接 ...