自制版制作步骤:

1.首先下载一个文件名为testng.xslt-1.1.zip

testng.xslt-1.1我在印象笔记里面备份了一份

打开testng.xslt中lib文件夹,找到saxon-8.7jar包
复制jar包到我们的工程存放的lib文件夹下,lib文件夹需要新建
  • 1
  • 2

2.把jar包导入到工程中

右键工程-properties-java build path-libraries-Add External jars-选择saxonjar包路径即可
  • 1
  • 2

3.xslt中的testng.results导入到工程中的test-out文件夹中

步骤:
找到testxslt-src-main-resoures-testresults,复制testresults到工程目录中的test-output文件夹中
  • 1
  • 2

创建build.xml文件

步骤:
右键项目-new-file名称为build.xml
  • 1
  • 2

 

build.xml内容-官方:

<?xml version="1.0" encoding="UTF-8"?>
<project name= "wushuaiTest" basedir= "." default="transform">
<property name= "lib.dir" value= "lib" />
<path id= "test.classpath" >
<!-- adding the saxon jar to your classpath -->
<fileset dir= "${lib.dir}" includes= "*.jar" />
</path>
<target name= "transform" >
<xslt in= "C:\Users\Administrator\eclipse-workspace\wushuaiTest\test-output/testng-results.xml" style= "C:\Users\Administrator\eclipse-workspace\wushuaiTest\test-output/testng-results.xsl"
out= "C:\Users\Administrator\eclipse-workspace\wushuaiTest\test-output/TestReport/index.html " >
<!-- you need to specify the directory here again -->
<param name= "testNgXslt.outputDir" expression= "C:\Users\Administrator\eclipse-workspace\wushuaiTest\test-output/TestReport" />
<classpath refid= "test.classpath" />
</xslt>
</target>
</project>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16

初始化build.xml

步驟:
右鍵build.xml-Run As-1.Ant Build
出现下图的BUILD SUCCESSFUL才算成功,
出现BUILD FAILED算失败
  • 1
  • 2
  • 3
  • 4

之后我们运行自动化之后就可以查看报告样式了

步骤:
执行完自动化脚本后-打开工程的testout-put文件夹-TestReport-index
打开index.xml即可,打开方式用火狐浏览器或者谷歌浏览器都可以,用ie浏览器就看不到如图所示的报告了
  • 1
  • 2
  • 3

selenium之生成html测试报告--testng.xsl的更多相关文章

  1. python+selenium +unittest生成HTML测试报告

    python+selenium+HTMLTestRunner+unittest生成HTML测试报告 首先要准备HTMLTestRunner文件,官网的HTMLTestRunner是python2语法写 ...

  2. selenium+Python(生成html测试报告)

    当自动化测试完成后,我们需要一份漂亮且通俗易懂的测试报告来展示自动化测试成果,仅仅一个简单的log文件是不够的 HTMLTestRunner是Python标准库unittest单元测试框架的一个扩展, ...

  3. Testng生成的测试报告乱码解决办法

    Testng生成的测试报告乱码解决办法 2017-06-16 1 问题描述 乱码是程序编码不统一,比如Java源代码是utf-8,编译是gbk,这时会乱码. 代码如下: org.testng.Repo ...

  4. 19.Selenium+Python生成测试报告

    1.代码如下所示: from selenium import webdriver import unittest import HTMLTestRunner class BaiduSearch(uni ...

  5. Python&Selenium&pytest借助allure生成自动化测试报告

    一.摘要 本篇博文将介绍Python和Selenium进行自动化测试时,如何借助allure生成自动化测试报告 二.环境配置 首先python环境中安装pytest和pytest_allure_ada ...

  6. Python&Selenium借助HTMLTestRunner生成自动化测试报告

    一.摘要 本篇博文介绍Python和Selenium进行自动化测试时,借助著名的HTMLTestRunner生成自动化测试报告 HTMLTestRunner.py百度很多,版本也很多,自行搜索下载放到 ...

  7. Python&Selenium借助html-testRunner生成自动化测试报告

    一.摘要 本博文将介绍Python和Selenium进行自动化测试时,借助html-testRunner 生成自动化测试报告 安装命令:pip install html-testRunner 二.测试 ...

  8. 自动化测试基础篇--Selenium unittest生成测试报告(HTMLTestRunner)

    如何生成HTMLTestRunner测试报告.接上篇文章,对于unittest框架,运行后,测试结果不便于查看,同时多个case存在的时候,可能会导致case result记录不正确的情况. 为此,引 ...

  9. Python+selenium自动化生成测试报告

    批量执行完用例后,生成的测试报告是文本形式的,不够直观,为了更好的展示测试报告,最好是生成HTML格式的. unittest里面是不能生成html格式报告的,需要导入一个第三方的模块:HTMLTest ...

随机推荐

  1. Oracle中存储图片的类型为BLOB类型,Java中如何将其读取并转为字符串?

    一,读取图片转为String类型: 需要使用Sun公司提供的Base64工具 String str = ((Map) list1.get(0)).get("EINVOICEFILE" ...

  2. ECMAScript 6 学习总结

    1.什么是ES6? 简单的说 ES6 的第一个版本,在2015年6月发布了,正式名称就是<ECMAScript 2015标准>(简称 ES2015)在2016年6月,小幅修订的<EC ...

  3. centos 7 安装sql 审核工具 inception + archer

    系统环境: Centos7 + python2.7 + python3 .... 下载 源码地址:https://github.com/mysql-inception/inception Incept ...

  4. Scrum Meeting 博客目录

    秘制牛肉团队 Scrum Meeting 博客汇总 一.Alpha阶段 团队第一次 # scrum meeting 团队第二次 # scrum meeting 团队第三次 # scrum meetin ...

  5. sql常用语句备忘录随时更新

    一.查询最新的一条数据 SELECT * FROM Table a WHERE NOT EXISTS (SELECT FROM Table b WHERE a.Date>b.Date) 二.查询 ...

  6. 导入数据库时报错1067 – Invalid default value for ‘字段名’

    最近把mysql升级到5.7了,wordpress导数据报错 Invalid default value for 'comment_date' 原因出在类似这样的语句 DROP TABLE IF EX ...

  7. Mybatis-spring 动态代理

    1.UserMapper.java package com.cn.mapper; import java.util.List; import com.cn.pojo.User; public inte ...

  8. Django 部署(Nginx+uwsgi)

    使用 uwsgi 来部署 安装 uwsgi sudo pip install uwsgi --upgrade 使用 uwsgi 运行项目 uwsgi --http :8001 --chdir /pat ...

  9. Fragment的粗浅理解

    Fragment: 1.它是对于Activity界面实现的一种途径,相对于已经绑定的Layout,他更轻便,更灵活,更具有自由度和可设计性. 2.Fragment的功能正如他的正文意思所言,他是一个片 ...

  10. Python 学习图谱

    https://mp.weixin.qq.com/s/-fJYAlOs4ui0YeJ-W6BkeQ