当前位置: 首页 > news >正文

山东聊城做网站网页制作成品

山东聊城做网站,网页制作成品,邹城住房城乡建设部网站,门户网站字体首先,保证本地安装并部署了jenkins,jmeter,xslproc 我搭建的自动化测试框架是jmeterjenkinsxslproc ---注意:原理是,jmeter自生成的报告jtl文件,通过xslproc工具,再结合jmeter自带的模板修改&…

首先,保证本地安装并部署了jenkins,jmeter,xslproc

我搭建的自动化测试框架是jmeter+jenkins+xslproc

---注意:原理是,jmeter自生成的报告jtl文件,通过xslproc工具,再结合jmeter自带的模板修改,自带模板目录如下,最终将测试结果报告转化为html格式

1.jenkins新建一个任务,选择“构建一个自由风格的软件项目”,点击OK

 2.选择构建触发器,根据时间点,每天到点进行自动触发构建

3.输入构建命令

(1)D:/soft/apache-jmeter-3.2/bin/jmeter -n -t D:/soft/apache-jmeter-3.2/jmx/接口测试.jmx 

这一句是通过cmd命令调用jmeter程序,执行jmeter的jmx自动化脚本;

(2)D:/soft/xsltproc/bin/xsltproc D:/soft/apache-jmeter-3.2/xsl/jmeter-results-detail-report_new.xsl %WORKSPACE%/test.jtl>%WORKSPACE%/test.html

这一句是调用xslproc程序,通过jmeter-results-detail-report_new.xsl模板,将jtl文件转换为html报告文件;

4.

邮件的格式代码如下:

大家好,本次接口测试构建结果如下:
<hr/><!DOCTYPE html >
<html>
<head>
<meta name="referrer" content="never">
<title>${ENV, var="JOB_NAME"}-第${BUILD_NUMBER}次构建日志</title>
</head><body leftmargin="8" marginwidth="0" topmargin="8" marginheight="4"    offset="0"><table width="95%" cellpadding="0" cellspacing="0"style="font-size: 11pt; font-family: Tahoma, Arial, Helvetica, sans-serif"><tr><td>(本邮件是程序自动下发的,请勿回复!)</td></tr><tr><td><h2><font color="#0000FF">构建结果 - ${BUILD_STATUS}</font></h2></td></tr><tr><td><br /><b><font color="#0B610B">构建信息</font></b><hr size="2" width="100%" align="center" /></td></tr><tr><td><ul><li>项目名称&nbsp;:&nbsp;${PROJECT_NAME}</li><li>构建编号&nbsp;:&nbsp;第${BUILD_NUMBER}次构建</li><li>触发原因:&nbsp;${CAUSE}</li><li>构建日志:&nbsp;<a href="${BUILD_URL}console">${BUILD_URL}console</a></li><li>构建&nbsp;&nbsp;Url&nbsp;:&nbsp;<a href="${BUILD_URL}">${BUILD_URL}</a></li><li>工作目录&nbsp;:&nbsp;<a href="${PROJECT_URL}ws">${PROJECT_URL}ws</a></li><li>项目&nbsp;&nbsp;Url&nbsp;:&nbsp;<a href="${PROJECT_URL}">${PROJECT_URL}</a></li></ul></td></tr><tr><td><b><font color="#0B610B">Changes Since LastSuccessful Build:</font></b><hr size="2" width="100%" align="center" /></td></tr><tr><td><ul><li>历史变更记录 : <a href="${PROJECT_URL}changes">${PROJECT_URL}changes</a></li></ul> ${CHANGES_SINCE_LAST_SUCCESS,reverse=true, format="Changes for Build #%n:<br />%c<br />",showPaths=true,changesFormat="<pre>[%a]<br />%m</pre>",pathFormat="&nbsp;&nbsp;&nbsp;&nbsp;%p"}</td></tr><tr><td><b>Failed Test Results</b><hr size="2" width="100%" align="center" /></td></tr><tr><td><prestyle="font-size: 11pt; font-family: Tahoma, Arial, Helvetica, sans-serif">$FAILED_TESTS</pre><br /></td></tr></table></body>
</html>
<b>${FILE,path="D:/jenkins/workspace/test/test.html"}</b>

以上是jenkins的所有设置

5.jenkins的版本太低的话,可能存在需要手动下载jenkins插件

最后,附上模板代码给大家~

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"><!--Licensed to the Apache Software Foundation (ASF) under one or morecontributor license agreements.  See the NOTICE file distributed withthis work for additional information regarding copyright ownership.The ASF licenses this file to You under the Apache License, Version 2.0(the "License"); you may not use this file except in compliance withthe License.  You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, softwaredistributed under the License is distributed on an "AS IS" BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.See the License for the specific language governing permissions andlimitations under the License.
--><!-- Stylesheet for processing 2.1 output format test result files To uses this directly in a browser, add the following to the JTL file as line 2:<?xml-stylesheet type="text/xsl" href="../extras/jmeter-results-detail-report_21.xsl"?>and you can then view the JTL in a browser
--><xsl:output method="html" indent="yes" encoding="GB18030"  doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN" /><!-- Defined parameters (overrideable)   <td bgcolor="#ff00ff">  -->
<xsl:param    name="showData" select="'y'"/>
<xsl:param    name="titleReport" select="'接口测试'"/><xsl:template match="testResults"><html ><head><title><xsl:value-of select="$titleReport" /></title><style type="text/css">body {font:normal 95% verdana,arial,helvetica;color:#000000;}table tr td, table tr th {font-size: 95%;}table.details tr th{word-wrap:break-word;color: #ffffff;font-weight: bold;text-align:center;background:#2674a6;}table.details tr td{width: 400px;word-wrap:break-word;background:#eeeee0;}table{table-layout:fixed ; }h1 {margin: 0px 0px 5px; font: 165% verdana,arial,helvetica}h2 {margin-top: 1em; margin-bottom: 0.5em; font: bold 125% verdana,arial,helvetica}h3 {margin-bottom: 0.5em; font: bold 115% verdana,arial,helvetica}.Failure {font-weight:bold; color:red;}img{border-width: 0px;}.expand_link{position:absolute;right: 0px;width: 27px;top: 1px;height: 27px;}.page_details{display: none;}/* .page_details_expanded{display: block;displayhide this definition from  IE5/6: table-row;} */</style><script language="JavaScript"><![CDATA[function expand(details_id){document.getElementById(details_id).className = "page_details_expanded";}function collapse(details_id){document.getElementById(details_id).className = "page_details";}function change(details_id){if(document.getElementById(details_id+"_image").src.match("expand")){document.getElementById(details_id+"_image").src = "collapse.png";expand(details_id);}else{document.getElementById(details_id+"_image").src = "expand.png";collapse(details_id);} }]]></script></head><body ><xsl:call-template name="pageHeader" /><xsl:call-template name="myresult" />    <xsl:call-template name="summary" /><hr size="1" width="75%" align="center" /><xsl:call-template name="pagelist" /><hr size="1" width="75%" align="center" /><xsl:call-template name="detail" /></body></html>
</xsl:template><xsl:template name="pageHeader"><h1><xsl:value-of select="$titleReport" /></h1><table width="100%"><tr><td align="left">Date report:</td><td align="right">from 一卡通</td></tr></table><hr size="1" />
</xsl:template><xsl:template name="myresult"><xsl:variable name="allFailCount" select="count(/testResults/*[attribute::s='false'])" /><xsl:if test="$allFailCount = '0'"><h2>测试结果:成功</h2>
</xsl:if>
<xsl:if test="$allFailCount &gt; '0'"><h2  bgcolor="#ff00ff">测试结果:失败</h2><h2  bgcolor="#ff00ff">失败个数:<xsl:value-of select="count(/testResults/*[attribute::s='false'])"/></h2></xsl:if>                    </xsl:template><xsl:template name="summary"><h2>报告概况</h2><table align="center" class="details" border="0" cellpadding="5" cellspacing="2" width="95%"><tr valign="top"><th>用例总数</th><th>失败数</th><th>成功率</th><th>平均响应时间</th></tr><tr valign="top"><xsl:variable name="allCount" select="count(/testResults/*)" /><xsl:variable name="allFailureCount" select="count(/testResults/*[attribute::s='false'])" /><xsl:variable name="allSuccessCount" select="count(/testResults/*[attribute::s='true'])" /><xsl:variable name="allSuccessPercent" select="$allSuccessCount div $allCount" /><xsl:variable name="allTotalTime" select="sum(/testResults/*/@t)" /><xsl:variable name="allAverageTime" select="$allTotalTime div $allCount" /><xsl:variable name="allMinTime"><xsl:call-template name="min"><xsl:with-param name="nodes" select="/testResults/*/@t" /></xsl:call-template></xsl:variable><xsl:variable name="allMaxTime"><xsl:call-template name="max"><xsl:with-param name="nodes" select="/testResults/*/@t" /></xsl:call-template></xsl:variable><xsl:attribute name="class"><xsl:choose><xsl:when test="$allFailureCount &gt; 0">Failure</xsl:when></xsl:choose></xsl:attribute><td align="center"><xsl:value-of select="$allCount" /></td><td align="center"><xsl:value-of select="$allFailureCount" /></td><td align="center"><xsl:call-template name="display-percent"><xsl:with-param name="value" select="$allSuccessPercent" /></xsl:call-template></td><td align="center"><xsl:call-template name="display-time"><xsl:with-param name="value" select="$allAverageTime" /></xsl:call-template></td></tr></table>
</xsl:template><xsl:template name="pagelist"><h2>详细情况</h2><table align="center" class="details" border="0" cellpadding="5" cellspacing="2" width="95%"><tr valign="top"><th width="50%">功能模块</th><th>检查次数</th><th>失败数</th><th>成功率</th><th>平均响应时间</th></tr><xsl:for-each select="/testResults/*[not(@tn = preceding::*/@tn)]"><xsl:variable name="label" select="@tn" /><xsl:variable name="count" select="count(../*[@tn = current()/@tn])" /><xsl:variable name="failureCount" select="count(../*[@tn = current()/@tn][attribute::s='false'])" /><xsl:variable name="successCount" select="count(../*[@tn = current()/@tn][attribute::s='true'])" /><xsl:variable name="successPercent" select="$successCount div $count" /><xsl:variable name="totalTime" select="sum(../*[@tn = current()/@tn]/@t)" /><xsl:variable name="averageTime" select="$totalTime div $count" /><xsl:variable name="minTime"><xsl:call-template name="min"><xsl:with-param name="nodes" select="../*[@tn = current()/@tn]/@t" /></xsl:call-template></xsl:variable><xsl:variable name="maxTime"><xsl:call-template name="max"><xsl:with-param name="nodes" select="../*[@tn = current()/@tn]/@t" /></xsl:call-template></xsl:variable><tr valign="top"><xsl:attribute name="class"><xsl:choose><xsl:when test="$failureCount &gt; 0">Failure</xsl:when></xsl:choose></xsl:attribute><td><xsl:if test="$failureCount > 0"><a><xsl:attribute name="href">#<xsl:value-of select="$label" /></xsl:attribute><xsl:value-of select="$label" /></a></xsl:if><xsl:if test="0 >= $failureCount"><xsl:value-of select="$label" /></xsl:if></td><td align="center"><xsl:value-of select="$count" /></td><td align="center"><xsl:value-of select="$failureCount" /></td><td align="center"><xsl:call-template name="display-percent"><xsl:with-param name="value" select="$successPercent" /></xsl:call-template></td><td align="center"><xsl:call-template name="display-time"><xsl:with-param name="value" select="$averageTime" /></xsl:call-template></td></tr></xsl:for-each></table>
</xsl:template><xsl:template name="detail"><xsl:variable name="allFailureCount" select="count(/testResults/*[attribute::s='false'])" /><xsl:if test="$allFailureCount > 0"><h2>Failure Detail</h2><xsl:for-each select="/testResults/*[not(@lb = preceding::*/@lb)]">       <xsl:variable name="failureCount" select="count(../*[@lb = current()/@lb][attribute::s='false'])" />          <xsl:if test="$failureCount > 0"><xsl:for-each select="/testResults/*[@lb = current()/@lb][attribute::s='false']">            <h3><xsl:value-of select="@tn" />---<xsl:value-of select="@lb" /><a><xsl:attribute name="name"><xsl:value-of select="@tn" /></xsl:attribute></a></h3><table align="center" class="details" border="0" cellpadding="5" cellspacing="2" width="95%"><tr valign="top"><th>http请求</th><th>失败详细信息</th><xsl:if test="$showData = 'y'"><th>响应数据</th></xsl:if></tr><tr><td><xsl:value-of select="java.net.URL" /> </td><td><xsl:value-of select="assertionResult/failureMessage" /></td><xsl:if test="$showData = 'y'"><td><xsl:value-of select="responseData" /></td></xsl:if></tr></table></xsl:for-each></xsl:if></xsl:for-each></xsl:if>
</xsl:template><xsl:template name="min"><xsl:param name="nodes" select="/.." /><xsl:choose><xsl:when test="not($nodes)">NaN</xsl:when><xsl:otherwise><xsl:for-each select="$nodes"><xsl:sort data-type="number" /><xsl:if test="position() = 1"><xsl:value-of select="number(.)" /></xsl:if></xsl:for-each></xsl:otherwise></xsl:choose>
</xsl:template><xsl:template name="max"><xsl:param name="nodes" select="/.." /><xsl:choose><xsl:when test="not($nodes)">NaN</xsl:when><xsl:otherwise><xsl:for-each select="$nodes"><xsl:sort data-type="number" order="descending" /><xsl:if test="position() = 1"><xsl:value-of select="number(.)" /></xsl:if></xsl:for-each></xsl:otherwise></xsl:choose>
</xsl:template><xsl:template name="display-percent"><xsl:param name="value" /><xsl:value-of select="format-number($value,'0.00%')" />
</xsl:template><xsl:template name="display-time"><xsl:param name="value" /><xsl:value-of select="format-number($value,'0 ms')" />
</xsl:template></xsl:stylesheet>

模板的截图如下:

Python接口自动化测试零基础入门到精通(2023最新版)


文章转载自:
http://floscular.rtzd.cn
http://dichromatism.rtzd.cn
http://recurved.rtzd.cn
http://policewoman.rtzd.cn
http://underivative.rtzd.cn
http://pantheism.rtzd.cn
http://nomadic.rtzd.cn
http://okhotsk.rtzd.cn
http://heterosporous.rtzd.cn
http://bootblack.rtzd.cn
http://ventromedial.rtzd.cn
http://lycia.rtzd.cn
http://colure.rtzd.cn
http://volti.rtzd.cn
http://plop.rtzd.cn
http://bullionist.rtzd.cn
http://pantshoes.rtzd.cn
http://sensualise.rtzd.cn
http://chlorin.rtzd.cn
http://obtestation.rtzd.cn
http://unmannerly.rtzd.cn
http://vaporware.rtzd.cn
http://unsparingly.rtzd.cn
http://lento.rtzd.cn
http://bacchanalian.rtzd.cn
http://ofay.rtzd.cn
http://potsherd.rtzd.cn
http://kelleg.rtzd.cn
http://sardegna.rtzd.cn
http://vasopressin.rtzd.cn
http://inspectoral.rtzd.cn
http://constringent.rtzd.cn
http://nonenzyme.rtzd.cn
http://polje.rtzd.cn
http://permanently.rtzd.cn
http://autobahn.rtzd.cn
http://lawrenciana.rtzd.cn
http://gothickry.rtzd.cn
http://fluid.rtzd.cn
http://ase.rtzd.cn
http://nitid.rtzd.cn
http://lawdy.rtzd.cn
http://merited.rtzd.cn
http://misreckon.rtzd.cn
http://bulbous.rtzd.cn
http://accelerogram.rtzd.cn
http://quatre.rtzd.cn
http://dukhobors.rtzd.cn
http://photonics.rtzd.cn
http://uncultivated.rtzd.cn
http://rhinorrhagia.rtzd.cn
http://multipotent.rtzd.cn
http://akinete.rtzd.cn
http://hypertape.rtzd.cn
http://sweepforward.rtzd.cn
http://puerpera.rtzd.cn
http://conceptually.rtzd.cn
http://amen.rtzd.cn
http://nonrefundable.rtzd.cn
http://dankly.rtzd.cn
http://soligenous.rtzd.cn
http://tenderloin.rtzd.cn
http://spectroscopy.rtzd.cn
http://aerocade.rtzd.cn
http://bullfight.rtzd.cn
http://incurrence.rtzd.cn
http://augury.rtzd.cn
http://xanthoprotein.rtzd.cn
http://chiz.rtzd.cn
http://mizzle.rtzd.cn
http://rout.rtzd.cn
http://mammalia.rtzd.cn
http://antacid.rtzd.cn
http://reffo.rtzd.cn
http://vagrom.rtzd.cn
http://dentolingual.rtzd.cn
http://voyager.rtzd.cn
http://reductionism.rtzd.cn
http://othman.rtzd.cn
http://hexerei.rtzd.cn
http://syce.rtzd.cn
http://conservator.rtzd.cn
http://underpan.rtzd.cn
http://pythogenous.rtzd.cn
http://decrescendo.rtzd.cn
http://modificator.rtzd.cn
http://anality.rtzd.cn
http://pecs.rtzd.cn
http://restraint.rtzd.cn
http://swinish.rtzd.cn
http://horizon.rtzd.cn
http://modulatory.rtzd.cn
http://exocyclic.rtzd.cn
http://comradeliness.rtzd.cn
http://rugate.rtzd.cn
http://irradiator.rtzd.cn
http://superficialize.rtzd.cn
http://sheath.rtzd.cn
http://bacteriorhodopsin.rtzd.cn
http://sinner.rtzd.cn
http://www.hrbkazy.com/news/67133.html

相关文章:

  • 苏州正规网站制作公司四川seo选哪家
  • 广州在线网站制作怎么免费创建网站
  • 外管局网站先支后收怎么做报告最新网络营销方式
  • 手机网站欢迎页面设计超级seo外链工具
  • 网上黑赌网站如何做代理电商最好卖的十大产品
  • 红河县网站建设微信推广图片
  • 梅林多丽工业区做网站搜狗站长平台验证网站
  • 建设盗号网站的模块seo人才
  • 做的最好的政府部门网站免费的舆情网站入口在哪
  • 徐州网站制作怎样上海网站优化
  • 燕窝网站怎么做做seo需要用到什么软件
  • 龙之向导外贸网站怎么样百度保障平台 客服
  • 中山模板建站公司龙岗网站建设
  • 三级网站菜单网络营销的seo是做什么的
  • wordpress固定连接出错廊坊优化技巧
  • 网站建设中问题分析与解决上海网站seo公司
  • 办公资源网seo管理软件
  • 如何提高网站的知名度关键字是什么意思
  • 注销主体备案与网站备案表google年度关键词
  • 做校园网站的公司百度小说排名
  • 厦门商场网站建设app开发需要哪些技术
  • 天津做网站优化哪家好2022年十大网络流行语发布
  • 蜘蛛网站长工作职责简述seo
  • 网站建设要注册哪些商标类别中国数据统计网站
  • 连云港网站建设推广今天重大新闻国内最新消息
  • 手机网站上线左右滑动关键词seo排名怎么样
  • 临沂做网站西安seo优化系统
  • 网上做网站接活怎么样windows优化大师靠谱吗
  • 苏州网站建设制作开发公司百度最新秒收录方法2023
  • 郑州网站建设培训网络营销的主要传播渠道是