0
我一直在更新我的Jmeter從2.9到2.13。我通常使用ant build和xslt來生成html報告。這裏是我的螞蟻xml腳本:Jmeter Xslt測試報告「嚴重錯誤!內容在prolog中不被允許」。
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="ballot.xsl"?>
<project default="all">
<!-- Define an environment variable pointing to JMETER folder or change this -->
<property environment="env"/>
<!-- <property name="jmeter-home" location="${env.JMETER_DIR}"/>-->
<property name="jmeter-home" location="C:\apache-jmeter-2.13"/>
<!-- ant-jmeter.jar comes with jmeter, be sure this is the release you have -->
<path id="ant.jmeter.classpath">
<pathelement
location="${jmeter-home}/extras/ant-jmeter-1.1.1.jar" />
</path>
<taskdef
name="jmeter"
classname="org.programmerplanet.ant.taskdefs.jmeter.JMeterTask"
classpathref="ant.jmeter.classpath" />
<target name="clean">
<delete dir="results2"/>
<delete file="jmeter.log"/>
<mkdir dir="results2/jtl"/>
<mkdir dir="results2/html"/>
</target>
<target name="test" depends="clean">
<jmeter
jmeterhome="${jmeter-home}"
resultlogdir="results2/jtl">
<testplans dir="IAM_jmeter" includes="*.jmx"/>
</jmeter>
</target>
<!-- This is not needed for the plugin, but it produces a nice html report
which can be saved usin hudson's archive artifact feature -->
<target name="report" depends="test">
<xslt
basedir="results2/jtl"
destdir="results2/html"
includes="*.jtl"
style="${jmeter-home}/extras/jmeter-results-detail-report_21.xsl"/>
</target>
<target name="all" depends="test, report"/>
</project>
它與jmeter 2.9一起工作。但是當我更新到2.13米時,它會產生一個錯誤。這裏是錯誤信息:
[xslt] Transforming into C:\Users\Administrator\Downloads\workspace\IAM-JmeterTest-Rest\results2\html
[xslt] Processing C:\Users\Administrator\Downloads\workspace\IAM-JmeterTest-Rest\results2\jtl\IAM_Jmeter.jtl to C:\Users\Administrator\Downloads\workspace\IAM-JmeterTest-Rest\results2\html\IAM_Jmeter.html
[xslt] Loading stylesheet C:\apache-jmeter-2.13\extras\jmeter-results-detail-report_21.xsl
[xslt] C:\Users\Administrator\Downloads\workspace\IAM-JmeterTest-Rest\results2\jtl\IAM_Jmeter.jtl:1:1: Fatal Error! Content is not allowed in prolog.
[xslt] Failed to process null
任何想法爲什麼? 感謝您的關注。