selenium之生成html测试报告--testng.xsl
2024-08-20 22:59:15
自制版制作步骤:
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
最新文章
- Android 如何制作九宫格图片(.9.png)
- 轻松搞定Win8 IIS支持SVC 从而实现IIS寄宿WCF服务
- C# asp.net mvc 配置多个route 参数
- linux 查看剩余内存数
- python-RabbitMQ基础篇
- 修复VirtualBox ";This kernel requires the following features not present on the CPU: pae Unable to boot
- [JS] 限制上传文件的类型和大小
- Flex4 中<;s:Datagrid>;、<;mx:Datagrid>;添加超链接的完整方法
- linux发展前景如何?
- The 7th Zhejiang Provincial Collegiate Programming Contest->;Problem G:G - Wu Xing
- 文件上传工具swfupload[转]
- oracle表空间使用情况查询
- 解决获取IP地址时出现“在一个非套…
- hdu 4455 Substrings (DP 预处理思路)
- C#:.net/方法/字符串/数组
- TypeScript笔记 6--接口
- ubuntu14.04安装、NVIDIA显卡驱动安装及CUDA8.0、Cudnn5.1的环境搭建
- java中的@Override标签
- Selenium元素定位之Xpath
- Habits of Considerate People
热门文章
- Ext.NET Grid Group分组使用
- java中Arrays的用法
- JavaWeb——tomcat manager 403 Access Denied .You are not authorized to view this page.
- Mybatis调用数据库的存储过程和方法
- python3中的urllib.parse的常用方法
- SQL Server事务
- 杰克.多西 twitter创始人 必做清单和不必做清单
- android toolbar效果
- python学习Day4 流程控制(if分支,while循环,for循环)
- 接入层高性能缓存技术nginx+redis利器OpenResty