自制版制作步骤:

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

最新文章

  1. Android 如何制作九宫格图片(.9.png)
  2. 轻松搞定Win8 IIS支持SVC 从而实现IIS寄宿WCF服务
  3. C# asp.net mvc 配置多个route 参数
  4. linux 查看剩余内存数
  5. python-RabbitMQ基础篇
  6. 修复VirtualBox &quot;This kernel requires the following features not present on the CPU: pae Unable to boot
  7. [JS] 限制上传文件的类型和大小
  8. Flex4 中&lt;s:Datagrid&gt;、&lt;mx:Datagrid&gt;添加超链接的完整方法
  9. linux发展前景如何?
  10. The 7th Zhejiang Provincial Collegiate Programming Contest-&gt;Problem G:G - Wu Xing
  11. 文件上传工具swfupload[转]
  12. oracle表空间使用情况查询
  13. 解决获取IP地址时出现“在一个非套…
  14. hdu 4455 Substrings (DP 预处理思路)
  15. C#:.net/方法/字符串/数组
  16. TypeScript笔记 6--接口
  17. ubuntu14.04安装、NVIDIA显卡驱动安装及CUDA8.0、Cudnn5.1的环境搭建
  18. java中的@Override标签
  19. Selenium元素定位之Xpath
  20. Habits of Considerate People

热门文章

  1. Ext.NET Grid Group分组使用
  2. java中Arrays的用法
  3. JavaWeb——tomcat manager 403 Access Denied .You are not authorized to view this page.
  4. Mybatis调用数据库的存储过程和方法
  5. python3中的urllib.parse的常用方法
  6. SQL Server事务
  7. 杰克.多西 twitter创始人 必做清单和不必做清单
  8. android toolbar效果
  9. python学习Day4 流程控制(if分支,while循环,for循环)
  10. 接入层高性能缓存技术nginx+redis利器OpenResty